Trying to make a simple PMODE kernel in DJGPP
Posted: Mon Dec 18, 2006 9:35 am
Hi all,
well, if you are all programming in Protected Mode and you suggest to make a OS in DJGPP, then I'd like to make a simple kernel in it too. (Well, I had to search in my memory for C++ language. All my mind is concentrated to Pascal)
OK. I downloaded DJGPP with C++ support from http://osdever.net, set up enviroment variables and come up with a tiny Hello World program:
I compiled and linked this program with this simple syntax:
So. What to do next? Does DJGPP somehow switch *automatically* to PMODE or I must do it myself?
Or I've used wrong functions and I must make my own to access Video RAM?
How can I please reduce the file size? My kernel in Pascal (uncompressed by UPX) has with at least *some* functions has 55 kB !
Thanks for any answers.
inflater
well, if you are all programming in Protected Mode and you suggest to make a OS in DJGPP, then I'd like to make a simple kernel in it too. (Well, I had to search in my memory for C++ language. All my mind is concentrated to Pascal)
OK. I downloaded DJGPP with C++ support from http://osdever.net, set up enviroment variables and come up with a tiny Hello World program:
Code: Select all
#include <conio.h>
#include <stdio.h>
void main()
{
cprintf("Hello World !");
getch();
}
It worked, in Windows and DOS, though. Application's size was incredibly 109 kB large and it didn't work under Alexei Frounze's bootloader.gcc hello.c -o hello.exe
So. What to do next? Does DJGPP somehow switch *automatically* to PMODE or I must do it myself?
Or I've used wrong functions and I must make my own to access Video RAM?
How can I please reduce the file size? My kernel in Pascal (uncompressed by UPX) has with at least *some* functions has 55 kB !
Thanks for any answers.
inflater