Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
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.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
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:
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
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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
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.
Last edited by neon on Wed Nov 18, 2009 5:06 pm, edited 1 time in total.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
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:
# 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.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
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.
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.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
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.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
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!