Building an Operating System - Implementing a basic printf

Building an Operating System - Implementing a basic printf

Francesco Boffa

2 года назад

9,910 Просмотров

Sure, puts and puthex did work, but for more complicated formatting needs, having to call multiple functions gets tiring quickly.


Welcome `printk`. For now only %d, %x, %p, %c and %s have been implemented, but that should be enough for a while.


Do you want to build your own? These can help:
- OSDev Wiki: https://wiki.osdev.org
- Intel Software Developer Manuals: https://software.intel.com/content/www/us/en/develop/articles/intel-sdm.html
Ссылки и html тэги не поддерживаются


Комментарии:

CodeForChange
CodeForChange - 07.11.2023 21:42

great content thank you very much, next time use a bigger font size please

Ответить
Josiah Ufono
Josiah Ufono - 18.07.2023 22:18

Font too tiny.

Ответить
Josiah Ufono
Josiah Ufono - 18.07.2023 22:17

Font too tiny.

Ответить
Ayanda Ntsele
Ayanda Ntsele - 23.01.2023 00:40

who can direct me to a similar demo but that we can read?

Ответить
Relaxing Nara
Relaxing Nara - 19.10.2022 02:21

Can you provide the source code after you were done

Ответить
miko007
miko007 - 16.08.2022 02:03

it would be great, if you could make the code a bit smaller. at the moment i am almost able to read it, which is inacceptable.

Ответить
WSM
WSM - 20.05.2022 21:28

Very informative video. Please upload more of this content. Also, zoom on the terminal for those watching through smartphones.

Ответить
Chukwuka Okorie
Chukwuka Okorie - 10.04.2022 11:49

who can help better explain this?

Ответить
Facebook
Facebook - 28.11.2021 03:22

i think the parameter pack was better for the printf args
exemple:
void printf(const char *msg)
{
// code
}
template <typename value_t, typename... args_t>
void printf(value_t val, value_t arg, args_t... args)
{
printf(val) ;
printf(arg, args...) ;
}

Ответить
RGChinoify
RGChinoify - 15.11.2021 18:17

Thank you. How can i implement return size?
my_printf("Hello world!\n") return value 13(including new line character "\n" and spaces)

Ответить
Luan Freitas
Luan Freitas - 31.10.2021 19:10

Amazing 👏🏻👏🏻👏🏻👏🏻

Ответить