Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Firstly, you cannot use the C/C++ Standard Library because, in a hobby OS, it doesn't exist*.</p> <p>Secondly, your C++ code seems to be in 32Bit format while your Assembly code is in 16Bit format. These cannot be linked unless both are 16 or both are 32.</p> <p>I recommend looking at the <a href="http://wiki.osdev.org/Main_Page" rel="noreferrer">OSDev Wiki</a> (user786653 posted that too)... It has many helpful resources to get you on your way to writing an Operating System.</p> <p>If you really want to start from scratch using 16Bit Assembly, and you want to be able to use 32Bit C++ code, you will have to do the following steps:</p> <ol> <li>Create a Bootloader's First Stage (A Small file that loads the rest of the bootloader.. It has to be exactly 512 Bytes...</li> <li>Create a Bootloader's Second Stage (This one sets up a GDT, enables the A20 Line, and switches to 32Bit Protected Mode.. - It can also set up a video mode, get RAM info, and pass that onto the 32Bit Kernel..).</li> <li>Create a 32Bit Kernel Stub (In C/C++.. Preferrably C). This Will create the main environment for the operating system's kernel.</li> <li>Write some C/C++ Standard Library Routines. String.h is your main priority (CString on C++). Also, a Stdio.h file would be useful (CStdio on C++)</li> <li>In the Kernel Stub's main function, call your print routine.</li> </ol> <p>(Note to do this you must have a high level of knowledge in C/C++ and at least some knowledge in Assembly)</p> <p>*If you programmed in your own library then disregard the first statement.</p> <p>Hope this helps!</p> <p>-Adrian</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload