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:
kieron
2016-10-14 21:58:34 +00:00
parent 6208fac551
commit e28d63ede3
3 changed files with 176 additions and 44 deletions

View File

@ -4,7 +4,8 @@ interface
uses
multiboot,
console;
console,
util;
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'];
begin
console_init();
console_writestringln('Asuro Booting...', #7);
console_writestringln('Asuro Booting...');
if (mbmagic <> MULTIBOOT_BOOTLOADER_MAGIC) then begin
console_writestringln('Multiboot Compliant Boot-Loader Needed!', #7);
console_writestringln('HALTING', #7);
console_setdefaultattribute(console_combinecolors(Red, Black));
console_writestringln('Multiboot Compliant Boot-Loader Needed!');
console_writestringln('HALTING');
asm
cli
hlt
end;
end;
console_writestringln('Asuro Booted Correctly!', #7);
console_writestring('Lower Memory = ', #7);
console_writeint(mbinfo^.mem_lower, #7);
console_writestringln('KB', #7);
console_writestring('Higher Memory = ', #7);
console_writeint(mbinfo^.mem_upper, #7);
console_writestringln('KB', #7);
console_writestring('Total Memory = ', #7);
console_writeint(((mbinfo^.mem_upper + 1000) div 1024) +1, #7);
console_writestringln('MB', #7);
console_setdefaultattribute(console_combinecolors(Green, Black));
console_writestringln('Asuro Booted Correctly!');
console_writestring('Lower Memory = ');
console_writeint(mbinfo^.mem_lower);
console_writestringln('KB');
console_writestring('Higher Memory = ');
console_writeint(mbinfo^.mem_upper);
console_writestringln('KB');
console_writestring('Total Memory = ');
console_writeint(((mbinfo^.mem_upper + 1000) div 1024) +1);
console_writestringln('MB');
asm
@loop:
jmp @loop
cli
hlt
end;
end;