Home Page | News | Documents | Screenshots | DexOS team | Downloads | Links | Forum


System Architecture

Kernel32.exe which is the main part of DexOS, is loaded by the DexOS's bootloader
(BootProg by Alexei A. Frounze) to 0x60 after some checks for things like "MZ" signature etc,
it does any relocating work, that is needed for a "MZ" exe, once that has been done the register
values are set to dl = boot drive number, cs:ip = program entry point, ss:sp = program stack,
ds = es = 50h, other stuff depends on exe header.
The first thing after being loaded, that kernel32.exe does is to check for all hdd and cd drives
and stores there address for later use, then the drive that the OS was booted from, is detected
and stored, next ram size is detected and stored, then what is present on pci-bus is also
detected, next PS2 mouse is detected and set up if present, then we enable A20, reprogram the
text fonts, finally we test for vesa, we are now ready to start the move from realmode to pmode.
More stuff maybe added here to test for as DexOS use base grows.

Next we 'cli' to turn off interrupts and then set up the GDT, to make addressing identical in
real mode and protected mode, we set the base of the code and data descriptors to DS * 16.
This number is computed at run-time, the other numbers in the GDT can be done at assemble-time,
at the same time we store the base-add-on, as we may need it later.
We also setup IDT,then we set the PE bit in register CR0 to begin the switch to protected mode,
then we execute a far JMP instruction.
We then move the "sys_data" (data descriptors) in to ax, to then be moved to ds, ss, es, fs, gs,
we are now in pmode, from here we remap pic, unmask irqs,
turn floppy motor off, Set keyboard leds, next we set text colors, store boot drive, and finally
set up DexOS's command line interface.