Some LibC String.h Functions and Editor Improvements - Amateur OS Dev (in C)

Channel:
Subscribers:
5,840
Published on ● Video Link: https://www.youtube.com/watch?v=SUIWHl7rRao



Duration: 2:01:56
713 views
28


This video goes over some misc changes & improvements: changing file size in the makefile to be more portable, fixing bochs harddrive booting, adding some C library string.h functions, using those string.h functions to reduce a few lines of code, and fixing up the text editor a bit more for deleting and inserting new characters.

My goal at the end of this video was to be in an okay starting place to write source files that can be processed in homemade tools. I'm planning on writing a simple (for me) 32bit x86 assembler, using assembly source files written in the OS text editor, to develop programs and run them all within the OS itself. This is technically doable already by using the hex editor, but hand assembling machine code can be a bit tedious for those who aren't named Mel :) https://www.pbm.com/~lindahl/mel.html

I'm not sure yet whether the assembler will lead to a compiler for a C-like or other higher level language, or if it will evolve into a high-level/macro assembler. Maybe both, given enough time...
(*as of 2023, I got sidetracked and haven't worked on an assembler yet, I might make a basic macro assembler for 16/32/64bit x86, a small subset at least, in C at some point).

Playlist for this series:
https://www.youtube.com/playlist?list=PLT7NbkyNWaqajsw8Xh7SP9KJwjfpP8TNX

Source code as of the end of this video:
https://git.sr.ht/~queso_fuego/amateur_os_video_sources/tree/master/item/34_string_h_editor_changes

Notes:
This was recorded with other people in the house, so I tried to be a little quieter, compensating with gain and limiter changes for the microphone. It's a little harder to talk and think at the same time when other people are in earshot. Getting better over time.
Putting up the test OS source on the side made sure I didn't have to think through writing changes, they were already made and working, although I'm not keen on that format for these videos.

I also added more short fades than usual between sudden jumps in the video, with slightly longer fades for longer periods between recordings. I hope this made it feel less jarring to watch, but if it's annoying or you have suggestions for video transitions or editing in general, let me know.

Next video(s) may be over: A physical memory manager, a small assembler, or other things

- Let me know if there is anything specific you'd like to see

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/
clang - https://clang.llvm.org/
davinci resolve - https://www.blackmagicdesign.com/products/davinciresolve/
OBS Studio - https://obsproject.com/

Peripherals:
Camera: Sony ZV-1, Elgato Camlink 4k
Microphone: Audio Technica AT2005USB, Focusrite Scarlett Solo
Keyboard: HHKB Pro Hybrid Type S, white/blank keycaps
Mouse: Logitech G502

Contact:
https://queso_fuego.srht.site/contact.html

Thoughts/Notes/Suggestions/Other - Drop a message in the video comments, twitter, or email

Outline:
0:00 - wc for file size, run bochs with harddisk
8:33 - string.h functions; strcmp/len/cpy & memset
28:57 - Use string.h functions in kernel
40:23 - Use string.h functions in editor
54:38 - Text editor file modes & user input file extension
1:15:23 - Text editor backspace/delete/delete line
1:37:20 - Text editor inserting characters/newlines
1:51:52 - Text editor change filename/ext keybind
2:00:56 - Outro

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 #stringh







Tags:
queso fuego
c programming
os dev
osdev
stringh
string functions
text editor
low level