diff --git a/Makefile b/Makefile index fa2869c..0e28fd2 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,26 @@ -TARGETS = boot_floppy.bin boot_usb.bin +TARGETS = boot_floppy.bin boot_usb.bin second_binary.bin boot_floppy.bin: boot_floppy.asm floppy.img nasm boot_floppy.asm -f bin -o boot_floppy.bin dd if=boot_floppy.bin of=floppy.img bs=512 count=1 conv=notrunc -boot_usb.bin: boot_usb.asm +boot_usb.bin: boot_usb.asm usb.img nasm boot_usb.asm -f bin -o boot_usb.bin + dd if=boot_usb.bin of=usb.img bs=512 count=1 conv=notrunc + +second_binary.bin: second_binary.asm floppy.img usb.img + nasm second_binary.asm -f bin -o second_binary.bin + dd if=second_binary.bin of=floppy.img bs=512 count=1 seek=3 conv=notrunc + dd if=second_binary.bin of=usb.img bs=512 count=1 seek=3 conv=notrunc + floppy.img: dd if=/dev/zero of=floppy.img bs=512 count=2880 +usb.img: + dd if=/dev/zero of=usb.img bs=512 count=2880 + clean: rm -rf $(TARGETS) diff --git a/bochsout b/bochsout index c6aae2b..27b7840 100644 --- a/bochsout +++ b/bochsout @@ -32,41 +32,41 @@ 00000000000i[ ] SB16 support: yes 00000000000i[ ] USB support: yes 00000000000i[ ] VGA extension support: vbe -00000000000i[MEM0 ] allocated memory at 0x7f93f621d010. after alignment, vector=0x7f93f621e000 +00000000000i[MEM0 ] allocated memory at 0x7fe55d4ff010. after alignment, vector=0x7fe55d500000 00000000000i[MEM0 ] 32,00MB 00000000000i[MEM0 ] mem block size = 0x00100000, blocks=32 00000000000i[MEM0 ] rom at 0xfffe0000/131072 ('/usr/local/share/bochs/BIOS-bochs-latest') -00000000000i[ ] lt_dlhandle is 0x1cbb760 +00000000000i[ ] lt_dlhandle is 0x23ee760 00000000000i[PLGIN] loaded plugin libbx_hdimage.so -00000000000i[ ] lt_dlhandle is 0x1cbc220 +00000000000i[ ] lt_dlhandle is 0x23ef220 00000000000i[PLGIN] loaded plugin libbx_pci.so -00000000000i[ ] lt_dlhandle is 0x1cbcb10 +00000000000i[ ] lt_dlhandle is 0x23efb10 00000000000i[PLGIN] loaded plugin libbx_pci2isa.so -00000000000i[ ] lt_dlhandle is 0x1cbd650 +00000000000i[ ] lt_dlhandle is 0x23f0650 00000000000i[PLGIN] loaded plugin libbx_usb_uhci.so -00000000000i[ ] lt_dlhandle is 0x1cbfcf0 +00000000000i[ ] lt_dlhandle is 0x23f2cf0 00000000000i[PLGIN] loaded plugin libbx_usb_common.so -00000000000i[ ] lt_dlhandle is 0x1cc0690 +00000000000i[ ] lt_dlhandle is 0x23f3690 00000000000i[PLGIN] loaded plugin libbx_acpi.so -00000000000i[ ] lt_dlhandle is 0x1cc1080 +00000000000i[ ] lt_dlhandle is 0x23f4080 00000000000i[PLGIN] loaded plugin libbx_cmos.so -00000000000i[ ] lt_dlhandle is 0x1cc19a0 +00000000000i[ ] lt_dlhandle is 0x23f49a0 00000000000i[PLGIN] loaded plugin libbx_dma.so -00000000000i[ ] lt_dlhandle is 0x1cc2420 +00000000000i[ ] lt_dlhandle is 0x23f5420 00000000000i[PLGIN] loaded plugin libbx_pic.so -00000000000i[ ] lt_dlhandle is 0x1cc2d10 +00000000000i[ ] lt_dlhandle is 0x23f5d10 00000000000i[PLGIN] loaded plugin libbx_pit.so -00000000000i[ ] lt_dlhandle is 0x1cc3790 +00000000000i[ ] lt_dlhandle is 0x23f6790 00000000000i[PLGIN] loaded plugin libbx_floppy.so -00000000000i[ ] lt_dlhandle is 0x1cc4470 +00000000000i[ ] lt_dlhandle is 0x23f7470 00000000000i[PLGIN] loaded plugin libbx_vga.so -00000000000i[ ] lt_dlhandle is 0x1cc3ea0 +00000000000i[ ] lt_dlhandle is 0x23f6ea0 00000000000i[PLGIN] loaded plugin libbx_ioapic.so -00000000000i[ ] lt_dlhandle is 0x1cc5670 +00000000000i[ ] lt_dlhandle is 0x23f8670 00000000000i[PLGIN] loaded plugin libbx_keyboard.so -00000000000i[ ] lt_dlhandle is 0x1cc6050 +00000000000i[ ] lt_dlhandle is 0x23f9050 00000000000i[PLGIN] loaded plugin libbx_harddrv.so -00000000000i[ ] lt_dlhandle is 0x1cc5330 +00000000000i[ ] lt_dlhandle is 0x23f8330 00000000000i[PLGIN] loaded plugin libbx_pci_ide.so 00000000000i[PLGIN] init_dev of 'pci' plugin device by virtual method 00000000000i[DEV ] i440FX PMC present at device 0, function 0 @@ -74,7 +74,7 @@ 00000000000i[DEV ] PIIX3 PCI-to-ISA bridge present at device 1, function 0 00000000000i[PLGIN] init_dev of 'cmos' plugin device by virtual method 00000000000i[CMOS ] Using local time for initial clock -00000000000i[CMOS ] Setting initial clock to: Sun Mar 30 18:09:12 2014 (time0=1396195752) +00000000000i[CMOS ] Setting initial clock to: Sun Mar 30 21:56:18 2014 (time0=1396209378) 00000000000i[PLGIN] init_dev of 'dma' plugin device by virtual method 00000000000i[DMA ] channel 4 used by cascade 00000000000i[PLGIN] init_dev of 'pic' plugin device by virtual method @@ -184,7 +184,6 @@ 00000000000i[XGUI ] Mouse capture off 00000000000i[XGUI ] Mouse capture off 00000000000i[MEM0 ] allocate_block: block=0x0 used 0x1 of 0x20 -00000000000i[XGUI ] Mouse capture off 00000004661i[BIOS ] $Revision: 11545 $ $Date: 2012-11-11 09:11:17 +0100 (So, 11. Nov 2012) $ 00000318067i[KBD ] reset-disable command received 00000320801i[BIOS ] Starting rombios32 @@ -231,114 +230,25 @@ 00001534975i[VBIOS] VBE Bios $Id: vbe.c,v 1.64 2011/07/19 18:25:05 vruppert Exp $ 00001600000i[XGUI ] charmap update. Font Height is 16 00014040328i[BIOS ] Booting from 0000:7c00 -00014040383i[XGUI ] Mouse capture off -00014237238i[XGUI ] charmap update. Font Height is 16 -00014237238i[XGUI ] Mouse capture off -00014240000i[XGUI ] system RESET callback -00014240000i[SYS ] bx_pc_system_c::Reset(HARDWARE) called -00014240000i[CPU0 ] cpu hardware reset -00014240000i[APIC0] allocate APIC id=0 (MMIO enabled) to 0x0000fee00000 -00014240000i[CPU0 ] CPU[0] is the bootstrap processor -00014240000i[CPU0 ] CPUID[0x00000000]: 00000005 756e6547 6c65746e 49656e69 -00014240000i[CPU0 ] CPUID[0x00000001]: 00000633 00010800 00002008 1fcbfbff -00014240000i[CPU0 ] CPUID[0x00000002]: 00410601 00000000 00000000 00000000 -00014240000i[CPU0 ] CPUID[0x00000003]: 00000000 00000000 00000000 00000000 -00014240000i[CPU0 ] CPUID[0x00000004]: 00000000 00000000 00000000 00000000 -00014240000i[CPU0 ] CPUID[0x00000005]: 00000040 00000040 00000003 00000020 -00014240000i[CPU0 ] CPUID[0x80000000]: 80000008 00000000 00000000 00000000 -00014240000i[CPU0 ] CPUID[0x80000001]: 00000000 00000000 00000101 2a100000 -00014240000i[CPU0 ] CPUID[0x80000002]: 20202020 20202020 20202020 6e492020 -00014240000i[CPU0 ] CPUID[0x80000003]: 286c6574 50202952 69746e65 52286d75 -00014240000i[CPU0 ] CPUID[0x80000004]: 20342029 20555043 20202020 00202020 -00014240000i[CPU0 ] CPUID[0x80000005]: 01ff01ff 01ff01ff 40020140 40020140 -00014240000i[CPU0 ] CPUID[0x80000006]: 00000000 42004200 02008140 00000000 -00014240000i[CPU0 ] CPUID[0x80000007]: 00000000 00000000 00000000 00000000 -00014240000i[CPU0 ] CPUID[0x80000008]: 00003028 00000000 00000000 00000000 -00014240000i[PLGIN] reset of 'pci' plugin device by virtual method -00014240000i[PLGIN] reset of 'pci2isa' plugin device by virtual method -00014240000i[PLGIN] reset of 'cmos' plugin device by virtual method -00014240000i[PLGIN] reset of 'dma' plugin device by virtual method -00014240000i[PLGIN] reset of 'pic' plugin device by virtual method -00014240000i[PLGIN] reset of 'pit' plugin device by virtual method -00014240000i[PLGIN] reset of 'floppy' plugin device by virtual method -00014240000i[PLGIN] reset of 'vga' plugin device by virtual method -00014240000i[PLGIN] reset of 'acpi' plugin device by virtual method -00014240000i[PLGIN] reset of 'ioapic' plugin device by virtual method -00014240000i[PLGIN] reset of 'keyboard' plugin device by virtual method -00014240000i[PLGIN] reset of 'harddrv' plugin device by virtual method -00014240000i[PLGIN] reset of 'pci_ide' plugin device by virtual method -00014240000i[PLGIN] reset of 'unmapped' plugin device by virtual method -00014240000i[PLGIN] reset of 'biosdev' plugin device by virtual method -00014240000i[PLGIN] reset of 'speaker' plugin device by virtual method -00014240000i[PLGIN] reset of 'extfpuirq' plugin device by virtual method -00014240000i[PLGIN] reset of 'parallel' plugin device by virtual method -00014240000i[PLGIN] reset of 'serial' plugin device by virtual method -00014240000i[PLGIN] reset of 'gameport' plugin device by virtual method -00014240000i[PLGIN] reset of 'iodebug' plugin device by virtual method -00014240000i[PLGIN] reset of 'usb_uhci' plugin device by virtual method -00014244661i[BIOS ] $Revision: 11545 $ $Date: 2012-11-11 09:11:17 +0100 (So, 11. Nov 2012) $ -00014558067i[KBD ] reset-disable command received -00014560801i[BIOS ] Starting rombios32 -00014561235i[BIOS ] Shutdown flag 0 -00014561830i[BIOS ] ram_size=0x02000000 -00014562251i[BIOS ] ram_end=32MB -00014602744i[BIOS ] Found 1 cpu(s) -00014616931i[BIOS ] bios_table_addr: 0x000fa448 end=0x000fcc00 -00014944728i[PCI ] i440FX PMC write to PAM register 59 (TLB Flush) -00015272655i[P2I ] PCI IRQ routing: PIRQA# set to 0x0b -00015272674i[P2I ] PCI IRQ routing: PIRQB# set to 0x09 -00015272693i[P2I ] PCI IRQ routing: PIRQC# set to 0x0b -00015272712i[P2I ] PCI IRQ routing: PIRQD# set to 0x09 -00015272722i[P2I ] write: ELCR2 = 0x0a -00015273488i[BIOS ] PIIX3/PIIX4 init: elcr=00 0a -00015281204i[BIOS ] PCI: bus=0 devfn=0x00: vendor_id=0x8086 device_id=0x1237 class=0x0600 -00015283474i[BIOS ] PCI: bus=0 devfn=0x08: vendor_id=0x8086 device_id=0x7000 class=0x0601 -00015285583i[BIOS ] PCI: bus=0 devfn=0x09: vendor_id=0x8086 device_id=0x7010 class=0x0101 -00015286429i[BIOS ] region 4: 0x0000c000 -00015288431i[BIOS ] PCI: bus=0 devfn=0x0a: vendor_id=0x8086 device_id=0x7020 class=0x0c03 -00015289252i[BIOS ] region 4: 0x0000c020 -00015289378i[UHCI ] new irq line = 9 -00015291263i[BIOS ] PCI: bus=0 devfn=0x0b: vendor_id=0x8086 device_id=0x7113 class=0x0680 -00015291496i[ACPI ] new irq line = 11 -00015291508i[ACPI ] new irq line = 9 -00015291579i[PCI ] setting SMRAM control register to 0x4a -00015455670i[CPU0 ] Enter to System Management Mode -00015455680i[CPU0 ] RSM: Resuming from System Management Mode -00015619698i[PCI ] setting SMRAM control register to 0x0a -00015634632i[BIOS ] MP table addr=0x000fa520 MPC table addr=0x000fa450 size=0xc8 -00015636388i[BIOS ] SMBIOS table addr=0x000fa530 -00015638583i[BIOS ] ACPI tables: RSDP addr=0x000fa650 ACPI DATA addr=0x01ff0000 size=0xf72 -00015641780i[BIOS ] Firmware waking vector 0x1ff00cc -00015643578i[PCI ] i440FX PMC write to PAM register 59 (TLB Flush) -00015644306i[BIOS ] bios_table_cur_addr: 0x000fa674 -00015771923i[VBIOS] VGABios $Id: vgabios.c,v 1.75 2011/10/15 14:07:21 vruppert Exp $ -00015771994i[BXVGA] VBE known Display Interface b0c0 -00015772026i[BXVGA] VBE known Display Interface b0c5 -00015774951i[VBIOS] VBE Bios $Id: vbe.c,v 1.64 2011/07/19 18:25:05 vruppert Exp $ -00016000000i[XGUI ] charmap update. Font Height is 16 -00028280324i[BIOS ] Booting from 0000:7c00 -00028280379i[XGUI ] Mouse capture off -00028338761i[XGUI ] charmap update. Font Height is 16 -00028338761i[XGUI ] Mouse capture off -00028477234i[XGUI ] Mouse capture off -00095588000p[XGUI ] >>PANIC<< POWER button turned off. -00095588000i[CPU0 ] CPU is in real mode (active) -00095588000i[CPU0 ] CS.mode = 16 bit -00095588000i[CPU0 ] SS.mode = 16 bit -00095588000i[CPU0 ] EFER = 0x00000000 -00095588000i[CPU0 ] | EAX=00001000 EBX=00000000 ECX=00090006 EDX=00000000 -00095588000i[CPU0 ] | ESP=0000ffd6 EBP=00000000 ESI=000e7c0b EDI=00000400 -00095588000i[CPU0 ] | IOPL=0 id vip vif ac vm rf nt of df if tf sf ZF af PF cf -00095588000i[CPU0 ] | SEG sltr(index|ti|rpl) base limit G D -00095588000i[CPU0 ] | CS:0000( 0004| 0| 0) 00000000 0000ffff 0 0 -00095588000i[CPU0 ] | DS:0000( 0005| 0| 0) 00000000 0000ffff 0 0 -00095588000i[CPU0 ] | SS:0000( 0005| 0| 0) 00000000 0000ffff 0 0 -00095588000i[CPU0 ] | ES:1000( 0005| 0| 0) 00010000 0000ffff 0 0 -00095588000i[CPU0 ] | FS:0000( 0005| 0| 0) 00000000 0000ffff 0 0 -00095588000i[CPU0 ] | GS:0000( 0005| 0| 0) 00000000 0000ffff 0 0 -00095588000i[CPU0 ] | EIP=00007c94 (00007c94) -00095588000i[CPU0 ] | CR0=0x60000010 CR2=0x00000000 -00095588000i[CPU0 ] | CR3=0x00000000 CR4=0x00000000 -00095588000i[CMOS ] Last time is 1396195775 (Sun Mar 30 18:09:35 2014) -00095588000i[XGUI ] Exit -00095588000i[CTRL ] quit_sim called with exit code 1 +00014400000i[XGUI ] charmap update. Font Height is 16 +00088108000p[XGUI ] >>PANIC<< POWER button turned off. +00088108000i[CPU0 ] CPU is in real mode (active) +00088108000i[CPU0 ] CS.mode = 16 bit +00088108000i[CPU0 ] SS.mode = 16 bit +00088108000i[CPU0 ] EFER = 0x00000000 +00088108000i[CPU0 ] | EAX=00000e00 EBX=00000002 ECX=00090004 EDX=00000000 +00088108000i[CPU0 ] | ESP=0000ffc2 EBP=0000ffca ESI=000e8047 EDI=00000400 +00088108000i[CPU0 ] | IOPL=0 id vip vif ac vm rf nt of df if tf sf ZF af PF cf +00088108000i[CPU0 ] | SEG sltr(index|ti|rpl) base limit G D +00088108000i[CPU0 ] | CS:0800( 0004| 0| 0) 00008000 0000ffff 0 0 +00088108000i[CPU0 ] | DS:0000( 0005| 0| 0) 00000000 0000ffff 0 0 +00088108000i[CPU0 ] | SS:0000( 0005| 0| 0) 00000000 0000ffff 0 0 +00088108000i[CPU0 ] | ES:1000( 0005| 0| 0) 00010000 0000ffff 0 0 +00088108000i[CPU0 ] | FS:0000( 0005| 0| 0) 00000000 0000ffff 0 0 +00088108000i[CPU0 ] | GS:0000( 0005| 0| 0) 00000000 0000ffff 0 0 +00088108000i[CPU0 ] | EIP=00000029 (00000029) +00088108000i[CPU0 ] | CR0=0x60000010 CR2=0x00000000 +00088108000i[CPU0 ] | CR3=0x00000000 CR4=0x00000000 +00088108000i[CMOS ] Last time is 1396209400 (Sun Mar 30 21:56:40 2014) +00088108000i[XGUI ] Exit +00088108000i[CTRL ] quit_sim called with exit code 1 diff --git a/boot_floppy.asm b/boot_floppy.asm index a3b4f86..a695ab0 100644 --- a/boot_floppy.asm +++ b/boot_floppy.asm @@ -18,9 +18,7 @@ [BITS 16] [org 0x7C00] -JMP short Start - -str: db 'THE GAME ',0x00 +JMP Start clear_screen: PUSH ax @@ -53,8 +51,8 @@ print_sector: PUSH bx PUSH cx PUSH dx - MOV al, [6 + ebp] ; num - MOV cl, [8 + ebp] ; offset + MOV al, [8 + ebp] ; num + MOV cl, [6 + ebp] ; offset MOV ah, 2 XOR ch, ch XOR dx,dx @@ -82,7 +80,7 @@ print_sector: POP ebp RETN -print_char: +print_char: PUSH ax PUSH bx MOV ah,0x0E ; Specifies that we want to write a character to the screen @@ -93,6 +91,27 @@ print_char: POP ax RETN +execute_sector: + PUSH ebp + MOV ebp, esp + PUSH ax + PUSH bx + PUSH cx + PUSH dx + MOV ax, [10 + ebp] ; base address + MOV es, ax + MOV al, [8 + ebp] ; num + MOV cl, [6 + ebp] ; offset + MOV ah, 2 ; Function read + XOR ch, ch ; cylinder + XOR dx,dx ; Head and drive + INT 0x13 + XOR si, si + PUSH es + PUSH bx + RETF + + Start: XOR ax, ax MOV ds, ax @@ -104,12 +123,15 @@ PUSH 2 ; num PUSH 2 ; offset CALL print_sector ; (offset, num) ADD esp, 4 -for_start_0: - MOV si,str - CALL print_string - ;JMP for_start_0 - JMP $ +MOV si,str +CALL print_string +PUSH 0x800; Base address, offset is 0 +PUSH 1 ; num +PUSH 4 ; offset +XOR bx, bx; +CALL execute_sector +str: db 'THE GAME',0x0A,0x0D,0x00 TIMES 510 - ($ - $$) db 0 DW 0xAA55 diff --git a/boot_floppy.bin b/boot_floppy.bin index 4444e84..a9377c9 100644 --- a/boot_floppy.bin +++ b/boot_floppy.bin diff --git a/boot_usb.asm b/boot_usb.asm new file mode 100644 index 0000000..efe80d5 --- /dev/null +++ b/boot_usb.asm @@ -0,0 +1,142 @@ +;BLACK 0x0 +;BLUE 0x1 +;GREEN 0x2 +;CYAN 0x3 +;RED 0x4 +;MAGENTA 0x5 +;BROWN 0x6 +;GREY 0x7 +;DARK_GREY 0x8 +;LIGHT_BLUE 0x9 +;LIGHT_GREEN 0xA +;LIGHT_CYAN 0xB +;LIGHT_RED 0xC +;LIGHT_MAGENTA 0xD +;LIGHT_BROWN 0xE +;WHITE 0xF + +[BITS 16] +[org 0x7C00] + +JMP Start + +clear_screen: + PUSH ax + MOV al, 03h ; Setting the graphical mode 80x25(text) + MOV ah, 00h ; Code of the function of changing video mode + INT 10h ; Call interruption + MOV cl, 0x06 + MOV ah, 0x01 + INT 10h + POP ax + RETN + +print_string: ; Expects null terminated message in si + PUSH ax + for_print_string_0: + MOV al,[si] + OR al,al + JZ end_for_print_string_0 + INC si + CALL print_char + JMP for_print_string_0 + end_for_print_string_0: + POP ax + RETN + +print_sector: + PUSH ebp + MOV ebp, esp + PUSH ax + PUSH bx + PUSH cx + PUSH dx + MOV al, [8 + ebp] ; num + MOV cl, [6 + ebp] ; offset + MOV ah, 2 + XOR ch, ch + XOR dh, dh + MOV dl, 0x80 + INT 0x13 + MOV di, 512 + XOR ah, ah + IMUL di, ax + XOR si, si + for_print_sector_0: + CMP si, di + JZ end_for_print_sector_0 + MOV al,[es:si] + OR al, al + JZ end_print_char_0 + CALL print_char + end_print_char_0: + INC si + JMP for_print_sector_0 + end_for_print_sector_0: + POP dx + POP cx + POP bx + POP ax + MOV esp, ebp + POP ebp + RETN + +print_char: + PUSH ax + PUSH bx + MOV ah,0x0E ; Specifies that we want to write a character to the screen + MOV bl,0x02 ; Specifies output text color. Not required, but useful to know + MOV bh,0x00 ; Page number. Leave this alone. + INT 0x10 ; Signal video interrupt to BIOS + POP bx + POP ax + RETN + +execute_sector: + PUSH ebp + MOV ebp, esp + PUSH ax + PUSH bx + PUSH cx + PUSH dx + MOV ax, [10 + ebp] ; base address + MOV es, ax + MOV al, [8 + ebp] ; num + MOV cl, [6 + ebp] ; offset + MOV ah, 2 ; Function read + XOR ch, ch ; cylinder + XOR dh, dh ; head + MOV dl, 0x80 ; drive + INT 0x13 + XOR si, si + PUSH es + PUSH bx + RETF + +Start: +XOR ax, ax +MOV ds, ax +MOV ax, 0x1000 +MOV es, ax +XOR bx, bx +CALL clear_screen +PUSH 2 ; num +PUSH 2 ; offset +CALL print_sector ; (offset, num) +ADD esp, 4 +MOV si,str +CALL print_string +PUSH 0x800; Base address, offset is 0 +PUSH 1 ; num +PUSH 4 ; offset +XOR bx, bx; +CALL execute_sector + + +str: db 'THE GAME',0x0A,0x0D,0x00 + +TIMES 510 - ($ - $$) db 0 +DW 0xAA55 + + + diff --git a/boot_usb.bin b/boot_usb.bin new file mode 100644 index 0000000..d54820b --- /dev/null +++ b/boot_usb.bin diff --git a/floppy.img b/floppy.img index 0234333..0c49e79 100644 --- a/floppy.img +++ b/floppy.img diff --git a/second_binary.asm b/second_binary.asm new file mode 100644 index 0000000..d689006 --- /dev/null +++ b/second_binary.asm @@ -0,0 +1,41 @@ +[BITS 16] +[org 0x8000] + +JMP short Start + +print_string: ; Expects null terminated message in si + for_print_string_0: + MOV al,[si] + OR al,al + JZ end_for_print_string_0 + INC si + CALL print_char + JMP for_print_string_0 + end_for_print_string_0: + RETN + +print_char: + MOV ah,0x0E ; Specifies that we want to write a character to the screen + MOV bl,0x02 ; Specifies output text color. Not required, but useful to know + MOV bh,0x00 ; Page number. Leave this alone. + INT 0x10 ; Signal video interrupt to BIOS + RETN + +Start: +XOR ax, ax +MOV ds, ax +MOV ax, 0x1000 +MOV es, ax +XOR bx, bx +for_start_0: + MOV si, str + CALL print_string + ;JMP for_start_0 + JMP $ + +str: db 'Hi! I',0x27,'m the second binary!',0x0A,0x0D,0x00 + +TIMES 510 - ($ - $$) db 0 + + + diff --git a/second_binary.bin b/second_binary.bin new file mode 100644 index 0000000..143300a --- /dev/null +++ b/second_binary.bin diff --git a/usb.img b/usb.img new file mode 100644 index 0000000..0c49e79 --- /dev/null +++ b/usb.img