alamme wrote:
Thx all for your reactions ... at first I heard of the protected/real mode, but don't know how to switch between these 2 ...
That is a fairly big, and fairly complicated, subject in and of itself, and has been the topic of many discussions on this board. I'd recommend checking out the p-mode tutorials on
OSRC, and searching this forum archives for earlier posts on the subject. Several of the books listed in the book thread will also help as well, such
The Indispensable PC Hardware Book.
I tried it with and without std-calls in a C++ ... tried it first without and out of pure desperation, I tried with the stdio ...
Also I tried a normal C code just with "Hello World" ...
Unfortunately, this isn't going to work, for the reasons I'd said above; the 'standard library calls' do not mean just the std ('stream-directed') class library, but
any functions not part of the core language. All of the 'normal C code' you are likely to have used relies on the library functions - [f|v|vs]printf(), [f]puts(), [f]putc(), and so forth. None of these will work at this stage, as they
all use system calls of some sort.
Rather, you will have to write functions to handle I/O yourself - which, in this case, means writing directly to the video text pages. Any other approach, short of dropping back into real mode and calling the BIOS (which would require a fair amount of assembly code), simply cannot work at this stage. Later, when you write the appropriate device drivers, you'll be able to port the standard libraries to your OS - but for now, you don't have even a simple BIOS interrupt at your disposal. Again, this has been discussed extensively in this forum, and a search on the archives should turn up quite a lot of information on how to write a simple print function.
The bootloader I ripped was from JOSH and I only modified it to debug, but the standard remains finally ...
That, at least, tells us something about what we're dealing with. Thank you. The JOSH tutorial is fairly popular and well-understood, which means that there should be few problems in helping you work with the boot loader.
There isn't any recent "good" source for now ... I think it will help a lot if I just knew how to load/compile the binairy kernel ...
Even 'bad' code would be better for us than trying to work blind, actually. Without it, all we can do is second-guess what you have done and where any problems lie.
One last thing: if you haven't already, please read through
"How to Ask Questions The Smart Way" and take the advice to heart. A bit more care in posing questions would have saved a fair amount of time for you right off the bat, and avoided the inevitable snide retorts that such a broad posting as your first one will get. After all, Tim did in fact answer you correctly; it wasn't his fault if your question was inadequate. Neither time nor patience are infinite; a little thought when you post will save both for everyone involved. That you didn't know that this was a good idea was simply because of inexperience, and no one will fault you for it so long as you learn from it and to do better in the future.