Question

I have some very specific questions about writing operating systems that I was hoping could get answered:

  1. How much assembly code would I need to write to load a minimal C Kernel if I use GRUB as a boot loader?

  2. My kernel will be written in C, It will load a command line shell that I wrote in C++, it does not make any API calls only standard library calls, will I need to rewrite the entire C++ Standard library to do so?

  3. Can I write video, keyboard and floppy drivers in C++?

  4. Do GCC and G++ output 16 bit real mode code?

  5. Can I write this all using Mingw on Windows or will I have to write it on Linux?

  6. Do I need to be in real mode in order to write directly to the video memory?

If anyone can answer my questions I will be very thankful

Était-ce utile?

La solution

1: You should only need a small amount of assembly to handle the boot process and load the C code. Shouldn't be more than like 20-30 lines I think.

2-4: I haven't really used C++ with OS dev, but I think I remember reading that it takes more work to get it running somewhere. Sorry I can't be of more help.

5: You "can" do it using MinGW, but from my experience it mostly complicates things. I could never really get a Windows environment working, but I also gave up without too much effort.

EDIT: Here is a link to some example assembly. This is all I ever had to use: http://www.jamesmolloy.co.uk/tutorial_html/2.-Genesis.html

The rest of that site is a pretty good tutorial too if you are at all interested in that kind of thing.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top