summaryrefslogtreecommitdiff
path: root/boot/mbr.asm
diff options
context:
space:
mode:
Diffstat (limited to 'boot/mbr.asm')
-rw-r--r--boot/mbr.asm28
1 files changed, 18 insertions, 10 deletions
diff --git a/boot/mbr.asm b/boot/mbr.asm
index 8483705..4513100 100644
--- a/boot/mbr.asm
+++ b/boot/mbr.asm
@@ -10,7 +10,7 @@
;
; * BOOT_DRIVE set
;
-; * 52 sectors of our kernel loaded at KERNEL_OFFSET from floppy
+; * X sectors of our kernel loaded at KERNEL_OFFSET from floppy
;
; * memory map made available at MEMMAP_OFFSET
; (check at MEMMEP_SIZE_OFFSET for number of entries)
@@ -45,12 +45,15 @@
;;where we will load our kernel into memory and some
;;other memory locations
;
-KERNEL_OFFSET equ 0x1000
+KERNEL_SECTOR equ 0x1000
+KERNEL_OFFSET equ 0x0000
+
MEMMAP_SIZE_OFFSET equ 0x7c00+0x600
MEMMAP_OFFSET equ 0x7c00+0x400
VESA_MODES equ 0x8300
VESA_MODE_INFO equ 0x8400
VESA_MODE_SELECT equ 0x4114
+
;
jmp boot_16 ;start boot process
db 'X'
@@ -94,22 +97,27 @@ CHECK_A20:
[bits 16]
;
boot_16:
+
+
+
+ ;first of allsetup the stack (Right under mbr)
+ ;guaranteed ~30KB space
+ mov bp,0x07bff
+ mov sp,bp
;
;
mov bx, STR_VERSION
call print_string
;
-;
-; ;setup the stack
- mov bp,0x8000
- mov sp,bp
-;
; ;remember BOOT_DRIVE (as was set by BIOS)
mov [BOOT_DRIVE],dl
;
-; ;Load the KERNEL (52 sectors starting at sector 2)
+; ;Load the KERNEL (sectors starting at sector 2)
+ mov ax,KERNEL_SECTOR
+ mov es,ax
mov bx,KERNEL_OFFSET
- mov dh, 53 ; for lba mode this is hardcoded anyway
+
+ mov dh, 53 ; for lba mode this is hardcoded anyway
mov dl, [BOOT_DRIVE]
call disk_load_16
@@ -160,7 +168,7 @@ boot_32_pm:
; call kernel!
mov eax,0 ;booting processor
- call KERNEL_OFFSET ;jump into our Kernel!
+ call 0x10000 ;KERNEL_SECTOR:KERNEL_OFFSET ;jump into our Kernel!
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;