Need help on these questions

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.
Post Reply
one

Need help on these questions

Post by one »

I've got a bunch of questions and would appreciate if any of you could
enlighten me on them.Here they go

1. Could anyone please tell me how i can debug with BOCHS in Windows98. I've got it working and can see my program but have no wayof stepping or tracing the execution.

2. I'm thinking of developing an OS and would like to know in what order the programming tasks should be dealt, like taskwise what can be done one by one . I've started with a FAT12 bootloader(but am stuck at the point of reading a file based on its FAT entries any help???). This should read in the secondary loader which I think must jump into protected mode and then load the kernel. Could anyone please give the specifics of implementing these, I mean you tell me what exactly each should do.

3. I've read somewhere that the BIOS reads the boot sector into memory at location 0000:7c00 or at 07c0:0000 well whats the difference?? how will it affect my code?? and what should I do to write a general boot loader?

4. I would also like to know how I can use GRUB to load my kernel file. I mean i've never used GRUB before. So please be detailed or just point me in the right direction.

Any help will be greatly appreciated
Ozguxxx

Re:Need help on these questions

Post by Ozguxxx »

As far as I know:
1) Bochs cannot trace code at least for now, if you try to configure while testing your code in bochs you can see that trace option is not yet implemented. Bochs has its own debug library or something like that but I think it is not very usable. But I think most people write messages in their code to see how far code goes and find bug in that way...

2) This is a very common question, but there is no answer to it; it is about your personality, go with the flow and os spirit will find you to start somewhere... But basically everybody starts by doing this hello world stuff in pmode and then ints, IDTs, keyboard and then memory management... BTW a fat12 bootlaoder link must be somewhere in forum doing some search might be helpful... Relevant link: http://osdev.neopages.net/tutorials/design.php?the_id=3

3) Your are radiated upon PHYSICAL MEMORY ADDRESS 0x7c00, so as long as you set up segment registers(remember that you are in real mode) appropriately you will not be in danger. Bootloader is being argued nowadays in some recent thread checking it out mght be helpful. Relevant link: http://osdev.neopages.net/tutorials/bru ... p?the_id=8

4) I dont use grub, but I think that will be a good likn to follow. Relevant link: http://osdev.neopages.net/tutorials/grub.php?the_id=5
Curufir

Re:Need help on these questions

Post by Curufir »

1) Bochs cannot trace code at least for now, if you try to configure while testing your code in bochs you can see that trace option is not yet implemented. Bochs has its own debug library or something like that but I think it is not very usable. But I think most people write messages in their code to see how far code goes and find bug in that way...
Nope, Bochs has a fairly comprehensive debugging mode that lets you do quite a lot of things (Reminds me of using DEBUG on DOS). If you're using Windows binaries you can access it by starting "bochsdbg" instead of "bochs", if you're using Linux or something else then compile the binary with --enable-debugger.

Documentation for the debugger is fairly primitive, but what there is appears on the Bochs sourceforge website. There's also a graphical frontend (I could never get the hang of this so I don't use it) if you want widgets and if you're feeling particularily brave you can hook Bochs up to gdb :o.

Hope that helps.
Post Reply