diff options
| author | Michal Idziorek <m.i@gmx.at> | 2014-09-02 14:53:09 +0200 |
|---|---|---|
| committer | Michal Idziorek <m.i@gmx.at> | 2014-09-02 14:53:09 +0200 |
| commit | 5348a94a6e7a16a070c502c29db30a08253a99a3 (patch) | |
| tree | a60838ee9c4b7ac854084fe0eeb0e579a5afc33d /boot | |
| parent | 347ee926fd09d7fb45025f2c4e4a4eeab83459c9 (diff) | |
Debugging paging problem on VirtualBox (VT-x)
Diffstat (limited to 'boot')
| -rw-r--r-- | boot/disk_load_16.asm | 8 | ||||
| -rw-r--r-- | boot/mbr.asm | 27 | ||||
| -rw-r--r-- | boot/pm.asm | 1 | ||||
| -rw-r--r-- | boot/vesa_setup_16.asm | 7 |
4 files changed, 27 insertions, 16 deletions
diff --git a/boot/disk_load_16.asm b/boot/disk_load_16.asm index 4222dd9..e45b89a 100644 --- a/boot/disk_load_16.asm +++ b/boot/disk_load_16.asm @@ -7,8 +7,8 @@ [bits 16] -DISK_LOAD_HANG_MSG: - db " D",0 +DISK_LOAD: + db "D",0 ;disk_load routune (load dh sectors from drive dl to es:bx) ;lba mode has 52 sectors hardcoded! @@ -48,10 +48,8 @@ disk_load_lba: lea si,[lba_adr] int 0x13 jc skip_print - - mov bx, 0x1000 + mov bx, DISK_LOAD call print_string - skip_print: popa diff --git a/boot/mbr.asm b/boot/mbr.asm index 4ece914..ca851c3 100644 --- a/boot/mbr.asm +++ b/boot/mbr.asm @@ -61,7 +61,7 @@ jmp $ ;entry for other processors ;) BOOT_DRIVE: db 0xff STR_VERSION: - db "v0.4",0 + db "v0.5",0 VESA_CHECK1: db "1",0 VESA_CHECK2: @@ -145,17 +145,30 @@ boot_32_pm: ; ;http://www.brokenthorn.com/Resources/OSDev9.html ; ;Method 3.1: Enables A20 through keyboard controller ; ;Not all keyboard controllers support this -; ;todo: check if this has any effect at all !?!? - mov al, 0xdd ; command 0xdd: enable a20 -; ;mov al, 0xdf ; command 0xdf: disable a20 - out 0x64, al ; send command to controller +; ; does not work in virtual box (with VT-x accerleration?) - mov eax,0 -; +; mov al, 0xdd ; command 0xdd: enable a20 +; mov al, 0xdf ; command 0xdf: disable a20 +; out 0x64, al ; send command to controller + + ;Fast A20 Gate: + ;http://wiki.osdev.org/A20_Line + + in al, 0x92 + or al, 2 + out 0x92, al + + ; call kernel! + mov eax,0 ;booting processor call KERNEL_OFFSET ;jump into our Kernel! ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; + +;fill partition table (4x16byte) with zeroes. +;(otherwise my Acer Aspire will not boot) +times 64 db 0x0 + ;so we get identified as MBR times 510-($-$$) db 0x0 ;dw 0x0 diff --git a/boot/pm.asm b/boot/pm.asm index 8a4f745..73bb9d3 100644 --- a/boot/pm.asm +++ b/boot/pm.asm @@ -11,6 +11,7 @@ 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 diff --git a/boot/vesa_setup_16.asm b/boot/vesa_setup_16.asm index 7180252..96e16e2 100644 --- a/boot/vesa_setup_16.asm +++ b/boot/vesa_setup_16.asm @@ -33,16 +33,15 @@ VesaSetup: jmp vesa_err2 vesa_ok2: - ;VESA: finally switch to the mode of choice! mov ax,0x4f02 ;vesa function: Set Mode mov bx,VESA_MODE_SELECT int 0x10 - vesa_err3: - mov bx, VESA_CHECK3 - call print_string cmp ax,0x004f je vesa_ok3 + vesa_err3 + mov bx, VESA_CHECK3 + call print_string jmp vesa_err3 vesa_ok3: popa |
