From dc7bf2f47d6f97407e3b50ae0b8ab59fd51079e5 Mon Sep 17 00:00:00 2001 From: Michal Idziorek Date: Thu, 14 May 2015 10:44:00 +0200 Subject: moving unused files folder --- xxx/boot2/pm.asm | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 xxx/boot2/pm.asm (limited to 'xxx/boot2/pm.asm') diff --git a/xxx/boot2/pm.asm b/xxx/boot2/pm.asm new file mode 100644 index 0000000..e6f3474 --- /dev/null +++ b/xxx/boot2/pm.asm @@ -0,0 +1,36 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;; Miguel's FoolOS Helper Functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; switch_to_pm - actual switch from 16bit real to 32bit protected +; init_pm - sets up some regs and calls boot_32_pm +; + +[bits 16] +switch_to_pm: + + cli ;switch off interrupts! + lgdt [gdt_descriptor] ;load descriptor table! +; lldt [gdt_descriptor] ;load descriptor table! (local) + + ;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, 0x07bff + mov esp, ebp + + call boot_32_pm ;continue booting in 32-bit protected mode -- cgit v1.2.3