I was just wondering with a C++ kernel to get it to Display Some words e.g.
"Welcome To MyOs"
Would u use cout<<"Welcome To MyOs";
or Something else?
and when I type
ld kernel.o -o kernel.bin -oformat binary -Ttext 0x100000
It comes up with a error saying No Such Dirrectory (I am using linux) is there a different way to link kernel.o?
And Could some one plz type a baisc VERY VERY basic OS in like a template to work on, with nothing in it but Hello world sorta thing, if not don't worrie about it.
C++ Kernel
Re:C++ Kernel
cout - just like printf() - is part of the standard library. When writing a new kernel, you do not have a standard library at your disposal, until you either implement one yourself or port an existing one to your kernel.Jankins wrote: Would u use cout<<"Welcome To MyOs";
or Something else?
Also, both cout and printf() write to standard output - which is set up by the C runtime environment. Your kernel, however, is not started by a C runtime, so you do not have a standard output.
The traditional way is to implement a scaled-down kprintf() (or kout) which can do basic output by writing directly to video memory.
Find attached a very early implementation of my own "testing" kernel. It might actually not compile correctly, as this is a snapshot of my working directory instead of a repository snapshot - I'm in the midst of a reinstallation of my machine.And Could some one plz type a baisc VERY VERY basic OS in like a template to work on, with nothing in it but Hello world sorta thing, if not don't worrie about it.
It requires GRUB to boot the kernel, and does nothing but printing some data from the GRUB multiboot header to screen.
[attachment deleted by admin]
Every good solution is obvious once you've found it.