summaryrefslogtreecommitdiff
path: root/boot
diff options
context:
space:
mode:
Diffstat (limited to 'boot')
-rw-r--r--boot/disk_load_16.asm15
-rw-r--r--boot/stage2.asm12
2 files changed, 14 insertions, 13 deletions
diff --git a/boot/disk_load_16.asm b/boot/disk_load_16.asm
index 764b80d..fe573ea 100644
--- a/boot/disk_load_16.asm
+++ b/boot/disk_load_16.asm
@@ -10,7 +10,7 @@
STR_ERROR:
db "Disk Read Error",0
-STR_SPACE
+STR_SPACE:
db " ",0
STR_OK:
@@ -41,12 +41,13 @@ disk_load_lba:
pusha
- mov bx,0x1000 ;target es:bx
+ mov bx,0x1800 ;target es:bx
mov es,bx
mov bx,0
next_sectors_lba:
+ jmp skip_debug_lba
;show es - target
pusha
mov bx,es
@@ -59,6 +60,8 @@ disk_load_lba:
popa
;--
+ skip_debug_lba:
+
mov [lba_addr_sector],es
mov ax,[LBA]
mov [lba_first_sector],ax
@@ -93,11 +96,11 @@ disk_load_chs:
pusha
- mov bx,0x1000 ;target es:bx
+ mov bx,0x1800 ;target es:bx
mov es,bx
mov bx,0
- next_sectors_chs
+ next_sectors_chs:
jmp skip_debug
pusha
@@ -147,7 +150,7 @@ disk_load_chs:
call print_nextline
- skip_debug
+ skip_debug:
mov ax,[LBA]
@@ -225,7 +228,7 @@ lba_adr:
dw 0x0000 ; target addr. offset
lba_addr_sector:
- dw 0x1000 ; target addr. sector
+ dw 0x1800 ; target addr. sector
lba_first_sector:
dw 10 ; first sector to read
diff --git a/boot/stage2.asm b/boot/stage2.asm
index de2497e..a1dbb46 100644
--- a/boot/stage2.asm
+++ b/boot/stage2.asm
@@ -37,16 +37,13 @@
;;where we will load our kernel into memory and some
;;other memory locations
;
-KERNEL_DATA equ 10 ;sector on disk where the kernel starts
-KERNEL_SECTOR equ 0x1000
-KERNEL_OFFSET equ 0x0000
-
MEMMAP_SIZE_OFFSET equ 0x7c00
MEMMAP_OFFSET equ 0x7c01
VESA_MODES equ 0x8300
VESA_MODE_INFO equ 0x8400
VESA_MODE_SELECT equ 0x4114
;
+
jmp boot_16 ;start boot process
;;SOME Global Data, mainly info/error strings
@@ -55,9 +52,9 @@ BOOT_DRIVE:
STR_VERSION:
db "Fool Loader Stage 2 v0.5",0
-STR_LOAD
+STR_LOAD:
db "Loading Kernel...",0
-STR_BOOT
+STR_BOOT:
db "Boot Drive: ",0
MEMMAP_INFO:
db "Getting Memory Map from BIOS.",0
@@ -112,6 +109,7 @@ boot_16:
mov bx,MEMMAP_INFO
call print_string
call print_nextline
+
;get memory map from bios before we enter 32 bit protected mode
mov ax,0 ; set target address in es:di (0:offset)
mov es,ax
@@ -137,5 +135,5 @@ boot_32_pm:
; call kernel!
mov eax,0 ;tell the kernel
; we are the booting processor
- call 0x10000 ;jump into our Kernel!
+ call 0x18000 ;jump into our Kernel!