'Full' C Conversion - Amateur OS Dev (in C)
Showing/explaining the "almost" full C version of the current OS. This is the code going forward and new development will probably be in C now. The bootsector/loader will stay assembly until/if a decent C implementation is found, and testfont/fileTable can be changed to any language that can output raw bytes to a file e.g. a shell script using echo. For now it's easy to keep assembling those with a separate assembler like fasm.
Source code as of the end of this video:
https://git.sr.ht/~queso_fuego/amateur_os_video_sources/tree/master/item/32_C_conversion
The current "memory map" for the OS is this, until paging or memory management is more fully developed:
1000h-1200h File table
1500h-1501h Drive #
1600h-1604h Keyboard structure; 1600: last ascii char, 1601: last scancode, 1602: left shift on/off, 1603: left ctrl on/off
2000h-5400h Kernel
6000h-6800h Font
7C00h-8400h Bootsector & bootloader
9000h-9100h Vesa Bios Extensions Mode info block
10000h+ Files/programs loaded from kernel
20000h+ Files loaded and edited in the editor, null file location in delete_file
Notes:
I won't have much time to record videos most of this year (2021), probably until October, maybe later.
I have family and pets living with me now and along with those time commitments, I'm anxious and self conscious about people hearing and seeing me work on things, and I think I'm bothering them even if that's not true. I can get about 20-30min during the week at lunch to record something, on a good day. I'm trying to get an hour or two in on some evenings/nights too if I can keep the noise down.
There's also some large projects at work going on, which last forever (.5-2 years on average).
They're mentally draining, and after 8 hours of work it's hard to focus on what is otherwise enjoyable (and refreshing!) programming.
I want to have something out every month if possible, either these videos or maybe shorter ones like data structure/algorithm problems. Ideally every week, alternating between an OS dev or other "major" project 1 week, and a smaller video like an algorithm problem or small game or graphics thing or something the next week. But that's unlikely to happen for now. Gonna try my best
On the bright side, I'm getting more sleep, food, and exercise, and cats are nice to have around (although I like dogs more!).
Next OS Dev video(s) might be:
Graphics primitives, fixing up the text/bin editor more, a physical/virtual memory manager, setting up paging, more of a C standard library, or something else
Outline:
0:00 - file tree
1:16 - makefile
8:05 - linker scripts
10:07 - stdint.h stub
11:29 - file_ops.h, delete_file & check_filename
25:00 - load_file
28:01 - rename_file
29:20 - save_file
33:28 - get_key.h
40:20 - print_char.h & print_string.h
51:20 - print_fileTable.h
54:41 - print_hex.h
57:03 - print_registers.h
1:01:13 - clear_screen.h
1:03:05 - cursor.h
1:06:42 - hex_to_ascii.h
1:07:29 - bootSect.asm
1:12:01 - calculator.c
1:24:01 - editor.c
2:07:06 - kernel.c
2:16:25 - cat walked in, cat break
2:17:14 - back to kernel.c
2:23:09 - closing thoughts & outro
Updates for this series and other things will be on twitter if I remember (not likely). I'll probably use the YT channel community tab for updates if future channel metrics are met. If people prefer, I can create a mailing list for updates, or tweet out stuff anyway
----------------------------------------------------------------------------------------------------------------------------------------
Playlist for this series:
https://www.youtube.com/playlist?list=PLT7NbkyNWaqajsw8Xh7SP9KJwjfpP8TNX
Git repos:
https://git.sr.ht/~queso_fuego/quesos
https://github.com/queso-fuego/amateuros
Software used:
VMware Workstation Player - https://www.vmware.com/products/workstation-player/workstation-player-evaluation.html
openBSD - https://www.openbsd.org/
qemu - https://www.qemu.org/
vim - https://www.vim.org/ (neovim is better)
fasm - https://flatassembler.net/
fasm docs - https://flatassembler.net/docs.php?article=manual
clang - https://clang.llvm.org/
davinci resolve - https://www.blackmagicdesign.com/products/davinciresolve/
OBS Studio - https://obsproject.com/
Contact:
email - fuegoqueso@gmail.com
twitter - @Queso_Fuego
Thoughts/Notes/Suggestions/Other - Drop a message in the video comments, by twitter, or by email
Credits:
Music from https://incompetech.com:
"Your Call" Kevin MacLeod (incompetech.com)
Licensed under Creative Commons: By Attribution 4.0 License
http://creativecommons.org/licenses/by/4.0/
The blue title tags:
#osdev #cprogramming #clang