Start create_file Function | 32 Bit OS Dev (in C)
From the only person to not cover the video title until 1 hour into the video, this one has a couple inode helper functions and starting a create file function for open(), which will take a while.
Errata:
- In inode_from_path(), reading all the blocks from an extent should be similar to j = extent.first_block while j is less than extent.first_block + extent.length_blocks.
As it is now, it only checks if j less than length_blocks, and the first block might be a value larger than length_blocks e.g. if first block = 32 and length = 2 then
the loop would never execute to begin with.
- In parent_inode_from_path(), if the last file in the path is a directory, then it returns that file, not its parent directory. That's not good.
OS Dev playlist:
https://www.youtube.com/playlist?list=PLT7NbkyNWaqajsw8Xh7SP9KJwjfpP8TNX
Git Repos:
Sourcehut: https://git.sr.ht/~queso_fuego/quesos
Github mirror: https://github.com/queso-fuego/amateuros
Repo state before open() syscall (this will be updated when open() and creating new files is mostly done):
git clone -n https://github.com/queso-fuego/amateuros
cd amateuros
git checkout 4255fe96f1efb69498eec2a55417dd3eca3eb2de
Join the Community Discord: https://discord.gg/yKm4T89QFn
Contact:
email: fuegoqueso@gmail.com
twitter: @Queso_Fuego
twitch: https://www.twitch.tv/queso_fuego
Next video:
- Mostly getting inode and data bits for a new file in fs_create_file()
- Let me know if there's anything specific you'd like to see!
Outline:
0:00 changes since last video
4:32 sectors_per_block constant
7:24 inode_for_name_in_directory()
30:37 parent_inode_from_path()
35:51 fail at debugging broken booting
55:16 fix for broken boot (shadowed variable...)
1:00:35 start fs_create_file()
1:26:47 strchr() & strrchr()
1:31:22 fs_create_file()
1:43:35 test strchr & strrchr
1:49:26 wrap up & outro
Questions about setup/software/etc.?
Check the FAQ: https://queso_fuego.srht.site/about.html
Music credits:
Morning Routine by Ghostrifter Official | https://soundcloud.com/ghostrifter-official
Music promoted by https://www.chosic.com/free-music/all/
Creative Commons CC BY-SA 3.0
https://creativecommons.org/licenses/by-sa/3.0/
#osdev #filesystem #inodes