Page 2 of 2

Re: 13h in C?!

Posted: Mon Oct 29, 2012 2:43 am
by Griwes
lemonyii wrote:
ellisvlad wrote: I am a hobby programmer who is very experienced in C/C++/OBJ-C/Java/etc. However I have never done anything with assembly.
Never can u be VERY experienced in C/C++ without understanding assembly. But soon u will i think.
Putting "C/C++" problem aside, yes, you can, the same way you can be a very experienced driver without understanding how a car engine is built or a very experienced EVE Online player without understanding Python and whatever the game client is written in.

I'm not saying that knowing how engine is built as a driver is redundant; quite the opposite, it can be helpful, but it's not a necessary knowledge to be able to get much experience with driving.

Re: 13h in C?!

Posted: Tue Nov 06, 2012 12:16 pm
by AbstractYouShudNow
I would suggest that you read http://atschool.eduweb.co.uk/camdean/pu ... ac/vga.htm
Also search the wiki for mapping terms, such as 'VGA', 'Graphics', 'Video' and always look at the external links.

However, mode 13h is a generic thing. You won't reach the performance of the latest games with just VGA. But I wonder if it is time for you to think of this.

To my mind, Operating System development must follow the following steps :
- Ensuring you already know everything needed. This is the first thing to do. Not only should you learn all the languages needed (assembly in your case; sorry too insist but this seems essential to me. Sometimes, anyway, you won't get the choice since several fields can't be achieved without assembly), but also you should download the full set of Intel manuals as PDFs http://www.intel.com/content/www/us/en/ ... nuals.html and study them seriously. You should first master the topic.
- Do good engeneering. Then, you can imagine the structure of your kernel (monolithic, mmodular, microkernel, a mixed architecture...), and find a model. You should come up already knowing what you are going to do.else, you may change your mind and go in any direction, following signs misleading to nowhere.
- Start by coding the boot. Since you are using GRUB, this point should be much shorter for you. It includes configuring GRUB (for example, so it sets up the correct video mode (e.g. mode 0x13), as well as the initialization of your kernel, loading its own GDT, enabling paging etc...
- Make your kernel provide good basic functionnality such as memory management, multitasking, etc. During all this time, you should only use a console interface for testing.
- Extend ! Once you've got a solid basis, then you can start extending. That's at this point, that you add graphics, networking and all the fancy things, including turning to a device driver model to allow you to support more different devices. That's typically the point where you start making your GUI.

For a good starting point in assembly, I suggest you Dr. Paul Carter's tutorial on protected mode assembly language. You should not be concerned about real mode or not much since you are using GRUB. http://www.drpaulcarter.com/pcasm/. Though I personnally no more use NASM but instead the good old GAS that comes with Binutils (and GCC) because it is more portable, more often available, and because it is complicated. Not that I am some kind of sado-masochist, but since it is complicated, it allows more advanced things, and also because it is the format use dby GCC's inline assembly. But I would say it is an 'advanced assembler', since it has been designed to be used as a back-end for GCC, it has poor error checking, so its a nightmare when beginning with assembly.

Also, if you really want your graphics to reach the highest performance available, which is essential for your OpenGL implementation to have hardware acceleration, a respectable set of extensions, and other things that will help you support high-end video-games or video editing applications, you should also use a graphics driver for your video card. You will see how fluid your graphics will look, compared to VGA ! :D

Maybe a next step will be to add sound 8)