Page 2 of 2

Re: Bootloader

Posted: Wed Nov 18, 2009 2:22 pm
by neon
ChrisSkura wrote:k, I am not using Bochs because It doesn't find anything on my floppy disk. I test my bootloader off startup and it prints out
Okay... I suspect the above is the problem. What do you mean by "off startup"? You test your bootloader on what if you dont use bochs? CD? Floppy disk? Emulator? Real PC? Need details, details, details! Does this disk have your kernel.bin on it? Dont guess here - physically put the disk in a Windows machine and check.

I also do not think bochs fails to find anything on the floppy disk unless i)It is configured incorrectly (your config file), or ii) There really is nothing on your boot disk.

...I am also still waiting for your bochs crash log.

Re: Bootloader

Posted: Wed Nov 18, 2009 3:11 pm
by ChrisSkura
k, after I've assembled my bootloader and my kernel, I drag my bootloader and kernel from c:\ to a:\ and it shows the Icons on the screen (and they are on my floppy disk) after that I use the debug function in command prompt:

Code: Select all

debug a:\boot.bin
w 100 0 0 1
in bochs even if I have a floppy disk in my computer with a bootable program on it, bochs acts like there's no floppy disk in my computer.

I test it by turning off my computer and putting in my floppy disk then turning the computer back on and waiting for my program to load. the bootloader loads and displays

loading boot image . . . . . . . . . . . . . . . . .

but then it doesn't load my kernel.

Re: Bootloader

Posted: Wed Nov 18, 2009 3:14 pm
by ChrisSkura
bochs doesn't really crash it just doesn't do anything.

Re: Bootloader

Posted: Wed Nov 18, 2009 3:31 pm
by Combuster
We might be able to help if you actually listened. There still is no bochs log, you repeat the same things over and over yet all the details are missing.

Are you even trying, because right now you are just wasting our time.

Re: Bootloader

Posted: Wed Nov 18, 2009 4:45 pm
by ChrisSkura
when I run bochs it says:

Booting from Floppy. . .
Booting failed: could not read the boot disk

FATAL: No bootable device.

Re: Bootloader

Posted: Wed Nov 18, 2009 5:02 pm
by neon
Post your configuration file please. Testing on real hardware is a good idea - but I highly do recommend using emulators and virtual environments as well - not just because it is easier, but also for the safety of your own machine.

It should not effect anything, however try writing your bootloader to the 1st sector first - then copy the kernel over.

Re: Bootloader

Posted: Wed Nov 18, 2009 5:09 pm
by neon
When you run bochs, select [2] (read options from) and type the filename in. The file is just a plain text file with options. For example, this should work for you:

Code: Select all

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

romimage:    file=BIOS-bochs-latest
vgaromimage: VGABIOS-lgpl-latest 

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

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

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

log:         Crash.log             # All errors and info logs will output to here
error:       action=report 
info:        action=report
Select [6] (or just hit <enter> after) and it should work. The bochs crash log is whatever filename you give it (its Crash.log) above.

Re: Bootloader

Posted: Wed Nov 18, 2009 5:34 pm
by ChrisSkura
when I try to load the config files it says

00000000000i[ ] reading configuration from c:\config.txt
00000000000p[ ] >>PANIC<< c:\config.txt: romimage directive: wrong # args.
00000000000i[SYS ] Last time is 0
00000000000i[ ] restoring default signal behavior
========================================================================
Bochs is exiting with the following message:
[ ] c:\config.txt: romimage directive: wrong # args.
========================================================================
00000000000i[CTRL ] quit_sim called with exit code 1

Bochs is exiting. Press ENTER when you're ready to close this window.

Re: Bootloader

Posted: Wed Nov 18, 2009 5:44 pm
by neon
Assuming you have an older version of bochs, try replacing the romimage line with romimage: file=BIOS-bochs-latest, address=0xf0000 If that fails to work, post the version of bochs that you are using.

Re: Bootloader

Posted: Wed Nov 18, 2009 5:50 pm
by Love4Boobies
I didn't really look at the code but I noticed your origins are 0 for both the kernel and the boot sector. Shouldn't you use whatever offset you load the kernel to and 7C00h, respectively? I'm unsure if that's really an issue; I didn't take a close look to see if the code is PIC.

Re: Bootloader

Posted: Wed Nov 18, 2009 5:53 pm
by ChrisSkura
one down, I got bochs working. I unistalled the version I had and installed v2.3

Re: Bootloader

Posted: Wed Nov 18, 2009 6:11 pm
by ChrisSkura
after testing it on bochs it just loops back to

main:

this part of the crash log keeps repeating

00001691169i[FDD ] read() on floppy image returns 0
00002540757i[FDD ] read() on floppy image returns 0
00003411845i[FDD ] read() on floppy image returns 0
00004282907i[FDD ] read() on floppy image returns 0
00005153950i[FDD ] read() on floppy image returns 0
00006024993i[FDD ] read() on floppy image returns 0
00006896036i[FDD ] read() on floppy image returns 0
00007767169i[FDD ] read() on floppy image returns 0
00008638257i[FDD ] read() on floppy image returns 0
00009511365i[FDD ] read() on floppy image returns 0
00010382453i[FDD ] read() on floppy image returns 0
00011253541i[FDD ] read() on floppy image returns 0

Re: Bootloader

Posted: Wed Nov 18, 2009 6:36 pm
by ChrisSkura
I got it working.

For some reason if I assemble my bootloader first and then assemble my kernel it doesn't work but if I assemble my kernel then my bootloader it works fine!

Thanks everyone that helped me get this working!

Re: Bootloader

Posted: Wed Nov 18, 2009 6:39 pm
by Love4Boobies
Maybe you don't read enough sectors and kernel.bin is too far away or something?