From b75c10c9d8c7405ba2f89724b485154d5201c404 Mon Sep 17 00:00:00 2001 From: Michal Idziorek Date: Fri, 5 Sep 2014 02:36:33 +0200 Subject: working on bootloaders (lba) --- boot0/mbr.asm | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'boot0/mbr.asm') diff --git a/boot0/mbr.asm b/boot0/mbr.asm index d24bbfe..9f5a51d 100644 --- a/boot0/mbr.asm +++ b/boot0/mbr.asm @@ -11,11 +11,14 @@ jmp stage1 STR_1: - db "Starting Fool Loader Stage 1. v0.1",0 + db "Fool Loader Stage 1. v0.1",0 STR_2: db "Starting Stage 2",0 +STR_BOOT: + db "boot drive: ",0 + BOOT_DRIVE: db 0xff ; remember the bootdrive here @@ -24,23 +27,40 @@ BOOT_DRIVE: stage1: + ;remember BOOT_DRIVE (as was set by BIOS) + mov [BOOT_DRIVE],dl + ;first of allsetup the stack (Right under mbr) ;guaranteed ~30KB space mov bp,0x07bff mov sp,bp - - ;remember BOOT_DRIVE (as was set by BIOS) - mov [BOOT_DRIVE],dl + call print_clear + call print_nextline + + ;pr message mov bx, STR_1 call print_string call print_nextline + ;show bootdrive + mov bx, STR_BOOT + call print_string + + mov al,[BOOT_DRIVE] + call print_hex_byte + call print_nextline + + call disk_load_16 ; loads stage 2 + ;entering stage2 message mov bx, STR_2 call print_string call print_nextline + + call print_nextline + mov dl,[BOOT_DRIVE] jmp 0x7e00 ; jump to next sector where we put stage 2 ;fill partition table (4x16byte) with zeroes. -- cgit v1.2.3