Adding Argc & Argv To The Kernel | 32 Bit OS Dev (in C)
Using argc/argv in place of tokens in the kernel, to pass command line arguments to called programs to use.
Also changing the editor to load a file passed in from argv.
OS Dev playlist:
https://www.youtube.com/playlist?list=PLT7NbkyNWaqajsw8Xh7SP9KJwjfpP8TNX
Source code for this video:
https://git.sr.ht/~queso_fuego/amateur_os_video_sources/tree/master/item/43_printf_terminal_argc_argv
Git Repos:
Sourcehut: https://git.sr.ht/~queso_fuego/quesos
Github mirror: https://github.com/queso-fuego/amateuros
Join the Community Discord: https://discord.gg/yKm4T89QFn
Notes:
- I did not get full strings parsed into tokens, that would be good to add. Some sort of light state machine or extra checks if a double quote is found, then iterate until the next double quote and have that full quoted string be its own token.
Contact:
email: fuegoqueso@gmail.com
twitter: @Queso_Fuego
twitch: https://www.twitch.tv/queso_fuego
Next video:
- Starting an ext2 or minix-esque filesystem to replace the current file table, making a program to write the new disk image.
- Let me know if there's anything specific you'd like to see!
Outline:
0:00 Overview
0:50 Add argc/argv to kernel
12:33 ctype.h and isspace() function
31:53 Use argc/argv for calling programs
38:02 Use argc/argv in the editor for loading files
49:31 Bugfixes (kind of) for the editor and delete_file()
1:02:21 Coming up & Outro
Questions about setup/software/etc.?
Check the FAQ: https://queso_fuego.srht.site/about.html
Updates may be on twitter, YouTube channel community tab, or the community discord, if I remember to update anything.
Music credits:
Downtown Glow by Ghostrifter & Devyzed
Creative Commons — Attribution-NoDerivs 3.0 Unported — CC BY-ND 3.0
Music promoted by https://www.chosic.com/free-music/all/
#osdev #printf #programming