diff options
| author | Michal Idziorek <m.i@gmx.at> | 2014-06-24 13:53:31 +0200 |
|---|---|---|
| committer | Michal Idziorek <m.i@gmx.at> | 2014-06-24 13:53:31 +0200 |
| commit | a99ca43066ba246475809a0e805bf52e8195debd (patch) | |
| tree | 1883030e358c15231599160ff1ce027b0cc20d22 /boot/pm.asm | |
Initial commit of FoolOS
FoolOS - the most useless OS in history.
Diffstat (limited to 'boot/pm.asm')
| -rw-r--r-- | boot/pm.asm | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/boot/pm.asm b/boot/pm.asm new file mode 100644 index 0000000..c66ab4f --- /dev/null +++ b/boot/pm.asm @@ -0,0 +1,27 @@ +[bits 16] +switch_to_pm: + + cli ;switch off interrupts! + lgdt [gdt_descriptor] ;load descriptor table! + + ;switch on 32-bit protected mode + mov eax, cr0 + or eax,0x1 + mov cr0, eax + + jmp CODE_SEG:init_pm + +[bits 32] +init_pm: + + mov ax, DATA_SEG + mov ds, ax + mov ss, ax + mov es, ax + mov fs, ax + mov gs, ax + + mov ebp, 0x90000 + mov esp, ebp + + call boot_32_pm ;continue booting in 32-bit protected mode |
