From c6e142673b65e6cb05e2bff213bffa20a81a7abc Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 19 Apr 2019 18:41:31 +0200 Subject: [PATCH] wait for user input --- Makefile | 0 README.md | 3 +++ boot.asm | 15 ++++++++++++++- boot.bin | Bin 512 -> 512 bytes disk.img | Bin 737280 -> 737280 bytes program.asm | 8 +++++++- program.bin | Bin 48 -> 58 bytes 7 files changed, 24 insertions(+), 2 deletions(-) mode change 100644 => 100755 Makefile mode change 100644 => 100755 README.md mode change 100644 => 100755 boot.asm mode change 100644 => 100755 boot.bin mode change 100644 => 100755 program.asm 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 25cacf7c2e6be6b844e3868b3936b346b8350392..2f0cf4925ddaa71044757a5b0cc739df9f464784 GIT binary patch delta 81 zcmV-X0IvUl1b_q}F~E-4j=;MBfR59N#Qd}X%@#Z`bOP&8zG{5vJ^;RpkrpW-oqXsH n0KT$(=m-F`0L>OLz|9$~2*7j(v<}S>>-EFyq_JL<0RmO3=yN3~ delta 51 zcmV-30L=e@1b_qv1*h7 Jk>CshRjO)`7ZU&g diff --git a/disk.img b/disk.img index 5fd68f7845efd9f937a781416970d6cfb8b691d5..b0380979681c19f83aec0f053e408e3f0b76516f 100755 GIT binary patch delta 157 zcmZo@&~0eYRWLlzccbsXZia@w%biF5Y+*PnW@Avo^g3W)R?Q1LhJD==#WWS?*1X_j z*te*3c+HpWe1ln!0>T2LXt-!;V3Ss~cpEhOAA w$dzFe`xd6Nip~5??fguPKn$XpftUq|S%H`hh}nUd1Bf|+m}@&f6Zdml04iKJ4FCWD delta 120 zcmZo@&~0eY6*D~0ccbsXZia@w%biF5?2D^;VaKqqexiaV`^1_Td<^@RO$?COm^FoQ z;sYMR&{eN_3ySj7ixP7cA_7947@8%S+9jD7ffz(H12GE_vjQ<25VHd@2M}`tG1qoU MChq696CZE^08>>cXaE2J 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 115c2234d5ffced1ca083bbb44f41c3388aef9b5..c6c4758101b3f013cf29a4aad6ed68de56730d8b 100644 GIT binary patch delta 31 mcmXr8l6)