diff --git a/Makefile b/Makefile old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 index 15d96fb..e4ed292 --- a/README.md +++ b/README.md @@ -21,3 +21,6 @@ https://en.wikipedia.org/wiki/BIOS_color_attributes ###Second stage bootloader booting from usb https://stackoverflow.com/questions/36044706/enable-the-boot-loader-to-load-the-second-sector-of-a-usb +###Tutorial on second stage / read interrupt BUT only for floppy :( +For disk see above +https://blog.ghaiklor.com/how-to-implement-a-second-stage-boot-loader-80e75ae4270c diff --git a/boot.asm b/boot.asm old mode 100644 new mode 100755 index 53932f5..8ecb4b1 --- a/boot.asm +++ b/boot.asm @@ -2,7 +2,7 @@ [org 0x7c00] ; Use the boot drive number passed to us by BIOS in register DL -start: +welcome: xor ax,ax ; We want a segment of 0 for DS for this question mov ds,ax ; Set AX to appropriate segment value for your situation mov es,ax ; In this case we'll default to ES=DS @@ -13,6 +13,14 @@ start: cld ; Set the direction flag to be positive direction +start: + mov ah, 0x00 + int 0x16 + cmp al, "0" + je load_it_all + jmp over + +load_it_all: mov si, wolf_wel_msg call wolf_print @@ -66,6 +74,11 @@ start: exit: ret + + +over: + jmp start + ; Moved the data before the boot signature but after the code wolf_wel_msg db 'Welcome to this publication...',0x0D,0x0A,0 wolf_kernel_load db 'Loading program',0x0D,0x0A,0 diff --git a/boot.bin b/boot.bin old mode 100644 new mode 100755 index 25cacf7..2f0cf49 Binary files a/boot.bin and b/boot.bin differ diff --git a/disk.img b/disk.img index 5fd68f7..b038097 100755 Binary files a/disk.img and b/disk.img differ diff --git a/program.asm b/program.asm old mode 100644 new mode 100755 index ea3bbb0..1a6e841 --- a/program.asm +++ b/program.asm @@ -1,9 +1,15 @@ [org 0x1000] + jmp start data: - msg db 'program XPUB',0 + msg db ' POETIC SOFTWARE',0 + start: + mov dl,7h + mov ah,2 + int 21h + MOV AH, 06h ; Scroll up function XOR AL, AL ; Clear entire screen XOR CX, CX ; Upper left corner CH=row, CL=column diff --git a/program.bin b/program.bin index 115c223..c6c4758 100644 Binary files a/program.bin and b/program.bin differ