5 ms·
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'?
by Kretiini 10y ago
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 10y agoYes, but it can also be done at kernel level if implemented as such. https://github.com/shawnanastasio/ShawnOS/blob/4345c74e84c5dbae73729a31fad608ffeae57d64/libsc/stdio/printf.c#L13 https://github.com/shawnanastasio/ShawnOS/blob/4345c74e84c5d... putchar() makes use of vga_textmode_putchar() which is a driver call: https://github.com/shawnanastasio/ShawnOS/blob/54be43196e310013da1b6d9f78448a0e94a905e5/kernel/drivers/vga/textmode.c https://github.com/shawnanastasio/ShawnOS/blob/54be43196e310...