Help! Bootloaders 1

If you are new to OS Development, plan on spending some time here first before going into the other forums.

Moderator:Moderators

Post Reply
Roland
Posts:4
Joined:Tue Feb 24, 2009 5:57 am
Help! Bootloaders 1

Post by Roland » Tue Feb 24, 2009 6:27 am

please help!

I assemble my bootloader.

Code: Select all


org		0x7c00				; We are loaded by BIOS at 0x7C00

bits	16					; We are still in 16 bit Real Mode

Start:

	cli					; Clear all Interrupts
	hlt					; halt the system
	
times 510 - ($-$$) db 0				; We have to be 512 bytes. Clear the rest of the bytes with 0

dw 0xAA55					; Boot Signiture
then i compile it with my MakeIt.bat

@echo off
nasm -f bin Boot1.asm -o Boot1.bin
pause

then open VFD, create a virtual floppy and its now on my computer, called 5 1/4 floppy(B).

then i do the partcopy and i think thats fine

@echo off
partcopy boot1.bin 0 200 -f1
pause

then i load up bochs and load these settings below.
then it says must end at 0xffffff and i just go cont
then it crashes saying the drive is not ready... but VFD is open and i copied the bin onto the floppy so i dont know what to do. Help please!


# ROM and VGA BIOS images ---------------------------------------------

romimage: file=BIOS-bochs-latest, address=0xf0000
vgaromimage: file=VGABIOS-lgpl-latest

# boot from floppy using our disk image -------------------------------

floppya: 1_44=a:, status=inserted # Boot from drive A

# logging and reporting -----------------------------------------------

log: OSDev.log # All errors and info logs will output to OSDev.log
error: action=report
info: action=report

User avatar
Mike
Site Admin
Posts:465
Joined:Sat Oct 20, 2007 7:58 pm
Contact:

Post by Mike » Tue Feb 24, 2009 4:20 pm

Hello,

Remove address=0xf0000 from the romimage line in your bochs configuration file so that it looks like this:

Code: Select all

romimage: file=BIOS-bochs-latest
Please try it with this new configuration and let us know what happens.

Roland
Posts:4
Joined:Tue Feb 24, 2009 5:57 am

Post by Roland » Tue Feb 24, 2009 7:50 pm

Hey, its working now! getting rid of the address thing stopped the panic. Then i realised floppya: 1_44=a
had to = b since i was using floppy B.
thanks for help and fast reply,
roland

Edit: In bootloaders 3, when i assemble it, it says Error: Program origin already defined, then gives the line which goes to org 0x1000 since there is already an org 0x7c00 at the start. What's wrong?

Andyhhp
Moderator
Posts:387
Joined:Tue Oct 23, 2007 10:05 am
Location:127.0.0.1
Contact:

Post by Andyhhp » Wed Feb 25, 2009 4:09 pm

NASM only lets you have a single ORG declaration per file.

you will need to remove the 2nd and adjust any addresses that rely on it.

~Andrew
Image

Post Reply