Hello, and this is my first post here, a pleasure to have entered the community...
I am still plotting out a small virtual machine that I've loosely been fumbling with the past three or four weeks, it is mostly in C++ (coded for Visual Studio). While no where near finished, I've been reconsidering where I want to go with this project, and have a few questions I would like to ask.
Before I do however, some background might be appropriate, there are a few facts that might change the outcome to my questions. I have not really done much in the way of assembly since the days of 8- and 16-bit machines, I expect a lot has changed, and as I understand it, making a boot-loader almost entirely requires things to be written in assembly. To further make my life difficult, I really want to work with long mode, since my machine has 24 GiB.
My goal, is to eventually get this virtual machine into a kind of toy operating system, which I can boot off of my USB, eventually I will want network, disk access, and optionally screen/keyboard as the main components. I'm not really making this program for distribution, more for my own personal fun.
My questions: Does evading an operating system increase performance of the assembly, is it fast than MSIL, or even nux*?
What are your opinions on shifting this project to a bootable OS? I got the time, patience, and determination(well - questionably the determination), should I even be considering this, as an educational process? or should I just put up with the pro's and con's of other OSes?
I'd be very happy to learn long mode assembly, how much of protected mode is required learning for this?
Any further things you would like to add?
As a side-note, I looked at some of the code required to boot into long-mode, I double checked it, and tried it on two machines, both computers simply just kept reseting on boot, is there any obvious reason for this?
Looking for a strategy on my next project...
-
- Posts: 2
- Joined: Mon Oct 31, 2011 12:16 pm
Re: Looking for a strategy on my next project...
It all depends on your goals.RunAwayKlepto wrote:My questions: Does evading an operating system increase performance of the assembly, is it fast than MSIL, or even nux*?
What are your opinions on shifting this project to a bootable OS? I got the time, patience, and determination(well - questionably the determination), should I even be considering this, as an educational process? or should I just put up with the pro's and con's of other OSes?
I'd be very happy to learn long mode assembly, how much of protected mode is required learning for this?
Any further things you would like to add?
As a side-note, I looked at some of the code required to boot into long-mode, I double checked it, and tried it on two machines, both computers simply just kept reseting on boot, is there any obvious reason for this?
I think it's best to consider the 'application' that you are writing (your virtual machine) and a possible OS project separately. It will be easier from a project management and design point of view. Consider the OS services that your VM needs. Consider how existing OS's provide them. Then consider how much effort it would be to build an OS yourself to provide all those services. Then you can start to consider whether your OS will provide those services with better performance than current OSes.
Building an OS is challenging and very rewarding if building an OS os your goal. If your real goal lies elsewhere, building an OS can be frustrating and a real stumbling block in a project.
You don't need much assembly. I use Grub to boot and my loader sets up long mode almost entirely in C. There are 6 assembly instructions before I call loader_main() and 5 more afterwards for getting to my kernel. I have some GCC inline functions to read/write control registers and the like but that's it. You do however need a very good understanding of the Intel and PC architecture.
If a trainstation is where trains stop, what is a workstation ?
Re: Looking for a strategy on my next project...
Leave "making your life difficult" for another day and save the patience for your project.RunAwayKlepto wrote: As a side-note, I looked at some of the code required to boot into long-mode, I double checked it, and tried it on two machines, both computers simply just kept reseting on boot, is there any obvious reason for this?
Get Pure64 bootloader from here:
http://www.returninfinity.com/baremetal.html
It has a C++ kernel example, so you even don't need to get in into assembly.
Long mode, Network , disk, keyboard supported, but not sure about the USB.
-
- Posts: 2
- Joined: Mon Oct 31, 2011 12:16 pm
Re: Looking for a strategy on my next project...
nice, I must say...Get Pure64 bootloader
Thx for the quick replies, and yeah - I think I'm going to have a go at this, spent the whole night (its currently 11AM) reading up on what exactly I will require for the project.
I'm still not exactly sure how to hook into my network cards, but I think I have most of the rest of what I need.
That bootloader is definatly worth a look, although - for educational purposes, I'm still going to see if I can't fudge out one of my own....
I did write a simple bootloader - but I compiled a previous bin file which over-wrote my asm file, guess I'm a little more tired than I thought, but atleast I'm half sure of how it works now....
Also found a nice article on mutex, sophamores, and deadlocks, mostly historical article, but was an interesting read =)
if I have any more questions, I'll post them on this thread, which will pretty much from here on in will be my OS devel thread.
I really needed to rewrite that VM anyhow, and including some OS style features will - for the most part - be fun...