
Implementing a basic x86 page frame allocator in C - adamnemecek
https://anastas.io/osdev/memory/2016/08/08/page-frame-allocator.html
======
Kretiini
Question: isn't printf a C standard library function? How can it be used in an
OS with no cstdlib (yet)? Or, is the code in the article 'just a guideline'?

~~~
pjmlp
Yes, but it can also be done at kernel level if implemented as such.

[https://github.com/shawnanastasio/ShawnOS/blob/4345c74e84c5d...](https://github.com/shawnanastasio/ShawnOS/blob/4345c74e84c5dbae73729a31fad608ffeae57d64/libsc/stdio/printf.c#L13)

putchar() makes use of vga_textmode_putchar() which is a driver call:

[https://github.com/shawnanastasio/ShawnOS/blob/54be43196e310...](https://github.com/shawnanastasio/ShawnOS/blob/54be43196e310013da1b6d9f78448a0e94a905e5/kernel/drivers/vga/textmode.c)

------
colejohnson66
Minor nitpick: `kernel_main' needs to be declared as cdecl for the assembly
call to work.

