OSDev.org

The Place to Start for Operating System Developers
It is currently Wed Oct 28, 2020 9:29 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: How to prepare floppy image for Bochs
PostPosted: Sat Aug 10, 2013 9:27 am 
Offline
Member
Member

Joined: Sun Feb 10, 2013 4:02 pm
Posts: 42
I have my code doing: move from real to protected mode with paging and some basic user interface (command line)
I am currently running it with dosbox :oops:

How to prepare floppy disk image for bochs and run it (using fat12 for example) ?
Are there any tutorials about this ?

I really don't know how to deal with bochs, it seems to be strange... is it possible there to debugg and view registers status, read operation memory (ram) ?

Hope to get some info about bochs but i am starting to have troubles with developing my os, and i need now to start debugging/view registers status/read operation memory, thank you!


Top
 Profile  
 
 Post subject: Re: How to prepare floppy image for Bochs
PostPosted: Sat Aug 10, 2013 9:34 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 3975
Location: Chichester, UK
I'd say that your first step should be to read the Bochs documentation. There seems little point in people repeating here what is adequately dealt with there.


Top
 Profile  
 
 Post subject: Re: How to prepare floppy image for Bochs
PostPosted: Sat Aug 10, 2013 11:45 am 
Offline
Member
Member

Joined: Mon Oct 29, 2012 2:26 pm
Posts: 27
You are asking 2 different questions.

Bochs is able to load any standard bootable disk. Without knowing how you were loading your code in dosbox, I'll just give you the options to make this happen. (described in http://wiki.osdev.org/Bootloader)

1. Use a pre-established bootloader and have it load your kernel (Grub is one example of this. http://wiki.osdev.org/GRUB)
2. Write your own bootloader and install it to the boot sector of a floppy image. (http://wiki.osdev.org/Rolling_Your_Own_Bootloader)

There is a 3rd option as well. If you use QEMU, it can boot directly into any multiboot compliant application without a bootloader. While not a long term development option, it is rather beneficial in the early stages.


Your other question is about how to debug in bochs. iansjack so helpfully refered you to the bochs documentation. In there, you will find that bochs has several modes of debugging. The first mode uses a built in debugger that will pop up a window and you can interact with the memory, registers, etc. Another mode allows you to attach a gdb debugger to bochs and actually debug your application in code. The built in debugger is easier to setup and probably more relevant for the stage that you are at, while the "real" debugger is a better long term option but requires more setup with your IDE/compiler chain.

-http://wiki.osdev.org/Bochs#Bochs_debugging_facilities
-http://bochs.sourceforge.net/doc/docbook/user/internal-debugger.html


Top
 Profile  
 
 Post subject: Re: How to prepare floppy image for Bochs
PostPosted: Sat Aug 10, 2013 4:04 pm 
Offline
Member
Member

Joined: Fri Nov 16, 2007 1:59 pm
Posts: 612
There are many tools to prepare floppy image. Usually I use my old mkfloppy sources. I'm working from time to time on new style mkfatxx (new style mkfat12 will replace old mkfloppy/mkfat12 soon). For example:
Code:
include "mkfat12.inc"

; use predefined volume size and calculate fat size automatically
fixed_availablesectors=2*80*18

; reset default values of some parameters
fixed_rootsize=14 ; sectors
fixed_media=0F0h
fixed_spt=18
fixed_heads=2

file "boot.bin"

orgd
  stof "content/grub.pk","GRUB    PK"
  stof "content/menu.lst","MENU    LST"
  orgd "SYSTEM"
    stof "content/system/kernel.bin","KERNEL  BIN"
  find
find

_________________
If you have seen bad English in my words, tell me what's wrong, please.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [Bot] and 18 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group