Simulators

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
winkle

Simulators

Post by winkle »

I'm starting my OS studies, but I'm not quite ready to deal with all of the machine specifics. What can I do to emulate these types of things on Linux in user space? I'm finding some things with google, but I'd like to hear what people have used. Are there there many programs for this express purpose, or will it be simple to cook something up myself? I'm quite new to this, so I don't know what all is required.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:Simulators

Post by Solar »

Of course you can write and test helper functions in user space - linked lists, descriptor tables etc. - just make sure you don't use any #includes, as they are unavailable in kernel space.

You can write up descriptor table handling in user space and double-check that it does write the correct values to the correct addresses - but unless you use that function on a real descriptor table in kernel space, you'd never know if it really works. And since any host OS hides descriptor tables, page tables etc. from its users, most such testing simply has to be done in "real" kernel space.

One good piece of software is Bochs (http://bochs.sourceforge.net), which allows you to emulate kernel space. You still have to deal with machine specifics, but you don't have to reboot your hardware all the time, and Bochs can give you valuable debug information whereas "real" hardware would simply freeze up.
Every good solution is obvious once you've found it.
winkle

Re:Simulators

Post by winkle »

I think you misunderstood me. I would like to simulate everything. I'm still learning theory and basic techniques. I want to emulate a process list and code a scheduler, and add on from there. I'm not concerned with making anything "real" at the moment. I really don't know what I need yet, because I don't know what it's all supposed to do.. Maybe some libraries to help this? I could take a peek at user-mode Linux I guess, it does mostly what I'm explaining, but if there are pre-canned teaching aids already there, I'd just assume use those.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:Simulators

Post by Solar »

You might also want to look at OSKit / OSLib, which provide a functional framework where you can pick out individual parts you want to modify / replace. Might be overkill though.
Every good solution is obvious once you've found it.
Post Reply