summaryrefslogtreecommitdiff
path: root/boot
diff options
context:
space:
mode:
Diffstat (limited to 'boot')
-rw-r--r--boot/disk_load_16.asm7
-rw-r--r--boot/mbr.asm28
-rw-r--r--boot/mp.asm4
-rw-r--r--boot/pm.asm2
4 files changed, 26 insertions, 15 deletions
diff --git a/boot/disk_load_16.asm b/boot/disk_load_16.asm
index fd05889..2fa88ee 100644
--- a/boot/disk_load_16.asm
+++ b/boot/disk_load_16.asm
@@ -34,6 +34,9 @@ disk_load_16:
;
int 0x13 ;bios interrupt
+ mov bx, DISK_LOAD
+ call print_string
+
popa
ret
@@ -61,8 +64,8 @@ lba_adr:
dw 53 ; number of sectors to read
- dw 0x1000 ; target addr.
- dw 0 ;
+ dw 0x0000 ; target addr. offset
+ dw 0x1000 ; target addr. sector
dd 1 ; first sector to read
dd 0 ;
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!
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
diff --git a/boot/mp.asm b/boot/mp.asm
index 497a0a8..0e1ec7f 100644
--- a/boot/mp.asm
+++ b/boot/mp.asm
@@ -1,6 +1,6 @@
; other processors will enter here!
-[org 0x7000]
+[org 0x9000]
jmp switch_to_pm
@@ -38,4 +38,4 @@ boot_32_pm:
mov eax,1
;
- call 0x1000 ;jump into our Kernel!
+ call 0x10000 ;jump into our Kernel!
diff --git a/boot/pm.asm b/boot/pm.asm
index 2d3d343..e6f3474 100644
--- a/boot/pm.asm
+++ b/boot/pm.asm
@@ -30,7 +30,7 @@ init_pm:
mov fs, ax
mov gs, ax
- mov ebp, 0x90000
+ mov ebp, 0x07bff
mov esp, ebp
call boot_32_pm ;continue booting in 32-bit protected mode