*very noob question* What is a very simple printf command?
*very noob question* What is a very simple printf command?
Ok I am pretty much a noob at OS dev but am a good c/++ programmer. I am also a visual kinda guy so I can learn from the most basic of code. I plan to make a hybrid monolithic-micro kernel so all the drivers and the filesystem. I am just asking for a basic one where it simply displays a character so I can test kernel and boot loader
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: *very noob question* What is a very simple printf comman
Have you checked the wiki? We have articles that explain this sort of stuff and the tutorials even offer some rudimentary examples.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
[ Project UDI ]
Re: *very noob question* What is a very simple printf comman
Oh I haven't seen that on the wiki thank you
-
- Posts: 11
- Joined: Thu Jan 03, 2013 4:40 pm
Re: *very noob question* What is a very simple printf comman
If you want to print to the screen in the bootloader use BIOS int 0x10h(assuming this is x86-architecture).
Printf in C is absolutely nothing like writing to video memory, or more directly interfacing with hardware.
Printf is a written command to parse syntax into string data for a text terminal, or I/O stream console, which doesn't even exist on a bare-system unless you make one.
There's plenty of tutorials on printing to the screen using "Hello World" in x86 Real Mode 16-bit bootloaders, and they're not really that hard.
Using an x86 virtual machine you can test it pretty instantly as well, if in fear of using real hardware directly to execute it(and for other reasons).
Printf in C is absolutely nothing like writing to video memory, or more directly interfacing with hardware.
Printf is a written command to parse syntax into string data for a text terminal, or I/O stream console, which doesn't even exist on a bare-system unless you make one.
There's plenty of tutorials on printing to the screen using "Hello World" in x86 Real Mode 16-bit bootloaders, and they're not really that hard.
Using an x86 virtual machine you can test it pretty instantly as well, if in fear of using real hardware directly to execute it(and for other reasons).
Re: *very noob question* What is a very simple printf comman
Thank you that helped a lot
Re: *very noob question* What is a very simple printf comman
Windows and Mac and numerous others have that hybrid. And I think a monolithic is too much and a micro kernel is not enough
Re: *very noob question* What is a very simple printf comman
Read barebones
Get back to work!
Github
Github
-
- Posts: 17
- Joined: Sat Jan 12, 2013 7:37 am
Re: *very noob question* What is a very simple printf comman
Heres something
this was on the wiki Printing To Screen
Code: Select all
// note this example will always write to the top
// line of the screen
void write_string( int colour, const char *string )
{
volatile char *video = (volatile char*)0xB8000;
while( *string != 0 )
{
*video++ = *string++;
*video++ = colour;
}
}
REAL programmers aren't afraid to use goto's