Console Updates:
- Added Colors as Enum. - Added Attribute Forming Function (Foreground + Background = Attribute). - Added Console Properties. - Added Default Attribute to Console Properties. - Created standard screen functions with an ex variant to specify/override default attr. - Started work on Caret/Cursor (re-)positioning. Util: - Added endianness conversion and various utils. git-svn-id: https://spexeah.com:8443/svn/Asuro@8 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
This commit is contained in:
1 parent
6208fac551
commit
e28d63ede3
3 files changed
+172
-40
No files matched your search
+127
-24
File diff suppressed because it is too large.
Load diff
+19
-16
@@ -4,7 +4,8 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
multiboot,
|
multiboot,
|
||||||
console;
|
console,
|
||||||
|
util;
|
||||||
|
|
||||||
procedure kmain(mbinfo: Pmultiboot_info_t; mbmagic: DWORD); stdcall;
|
procedure kmain(mbinfo: Pmultiboot_info_t; mbmagic: DWORD); stdcall;
|
||||||
|
|
||||||
@@ -13,28 +14,30 @@ implementation
|
|||||||
procedure kmain(mbinfo: Pmultiboot_info_t; mbmagic: DWORD); stdcall; [public, alias: 'kmain'];
|
procedure kmain(mbinfo: Pmultiboot_info_t; mbmagic: DWORD); stdcall; [public, alias: 'kmain'];
|
||||||
begin
|
begin
|
||||||
console_init();
|
console_init();
|
||||||
console_writestringln('Asuro Booting...', #7);
|
console_writestringln('Asuro Booting...');
|
||||||
if (mbmagic <> MULTIBOOT_BOOTLOADER_MAGIC) then begin
|
if (mbmagic <> MULTIBOOT_BOOTLOADER_MAGIC) then begin
|
||||||
console_writestringln('Multiboot Compliant Boot-Loader Needed!', #7);
|
console_setdefaultattribute(console_combinecolors(Red, Black));
|
||||||
console_writestringln('HALTING', #7);
|
console_writestringln('Multiboot Compliant Boot-Loader Needed!');
|
||||||
|
console_writestringln('HALTING');
|
||||||
asm
|
asm
|
||||||
cli
|
cli
|
||||||
hlt
|
hlt
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
console_writestringln('Asuro Booted Correctly!', #7);
|
console_setdefaultattribute(console_combinecolors(Green, Black));
|
||||||
console_writestring('Lower Memory = ', #7);
|
console_writestringln('Asuro Booted Correctly!');
|
||||||
console_writeint(mbinfo^.mem_lower, #7);
|
console_writestring('Lower Memory = ');
|
||||||
console_writestringln('KB', #7);
|
console_writeint(mbinfo^.mem_lower);
|
||||||
console_writestring('Higher Memory = ', #7);
|
console_writestringln('KB');
|
||||||
console_writeint(mbinfo^.mem_upper, #7);
|
console_writestring('Higher Memory = ');
|
||||||
console_writestringln('KB', #7);
|
console_writeint(mbinfo^.mem_upper);
|
||||||
console_writestring('Total Memory = ', #7);
|
console_writestringln('KB');
|
||||||
console_writeint(((mbinfo^.mem_upper + 1000) div 1024) +1, #7);
|
console_writestring('Total Memory = ');
|
||||||
console_writestringln('MB', #7);
|
console_writeint(((mbinfo^.mem_upper + 1000) div 1024) +1);
|
||||||
|
console_writestringln('MB');
|
||||||
asm
|
asm
|
||||||
@loop:
|
cli
|
||||||
jmp @loop
|
hlt
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
unit util;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
function util_hi(b : byte) : byte;
|
||||||
|
function util_lo(b : byte) : byte;
|
||||||
|
function util_switchendian(b : byte) : byte;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
function util_hi(b : byte) : byte; [public, alias: 'util_hi'];
|
||||||
|
begin
|
||||||
|
util_hi:= (b AND $F0) SHR 4;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function util_lo(b : byte) : byte; [public, alias: 'util_lo'];
|
||||||
|
begin
|
||||||
|
util_lo:= b AND $0F;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function util_switchendian(b : byte) : byte; [public, alias: 'util_switchendian'];
|
||||||
|
begin
|
||||||
|
util_switchendian:= (util_lo(b) SHL 4) OR util_hi(b);
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
Reference in new issue
Block a user