🌿 E14: Weekly kernel dev gardening in C, x86: CGA Display Driver 🌿

  Рет қаралды 483

offlinemark

offlinemark

20 күн бұрын

(detailed timestamps in comments)
#livecoding #softwareengineering #operatingsystem
discord: / discord
Welcome! This is my chill Operating Systems development "gardening" project.
The "gardening philosophy" is to have fun, above everything else. This means taking baby steps and locking in small wins before building up for more ambitious projects. People also call this "hacking" on something.
My personal goal & vision is to build a minimal, high quality OS foundation which can be used for play, experimentation, and learning.
I'm personally not an expert systems programmer, although I'd like to be someday. Right now, but I'm just an intermediate one - I worked in infosec for 7 years, and music tech for 3 years. I've been exposed to the Linux kernel in both settings, but in highly constrained contexts, and mostly reading code, not writing it.
0:00 start
0:26: 🧐 Struggling with fixing a malfunctioning build before starting the stream.
10:21: 🌿 Discussion on memory mapping in kernel development and fixing a previous change in the code.
20:00: 📚 Exploring Intel manuals to understand global descriptor table entries for software initialization in protected mode.
30:08: 💻 Discussion on the TSS task selector, kernel boot-up process, and print F function in C.
39:14: 🧠 Discussion on interpreting formatstring in C printF function and accessing corresponding arguments using VA list.
49:02: 💻 Exploration of CGA display technology in kernel development, isolating code for serial console interaction.
58:02: 🧠 Analysis of the structure of the colonel's work, focusing on program headers in binaries.
1:07:51: 🧠 Understanding the physical memory address mapping in the kernel development process.
1:17:05: 🧐 Exploring challenges in accessing memory and understanding CGA display driver in kernel development.
1:29:46: 💻 Understanding the control registers and access method of the video controller in the graphics card.
1:39:24: 🌱 Exploring CGA display driver functionalities and debugging process.
1:49:14: 🕹️ Exploring debugging issues while working on writing characters to display in C programming.
1:59:25: 🖥️ Overview of CRT calls, memove function, and screen scrolling in C programming
Recapped using Tammy AI

Пікірлер: 5
@offlinemark
@offlinemark 18 күн бұрын
0:26: 🌱 Troubleshooting build errors, preparing for OS class labs, and setting up Intel manual. 0:26: Struggling with build errors and debugging process 1:52: Attempting to fix build issues live and seeking help 4:46: Resorting to online search for solutions 6:06: Successfully resolving build error and making a commit 8:03: Continuing with MIT OS class labs exploration 9:20: Getting ready with Intel manual for future reference 9:28: Mentioning a bug in the room and warming up for the session 9:42: Planning to start working on segmentation exercise 12:41: 🧠 Exploration of transitioning to protected mode in x86 assembly via GDT manipulation. 12:41: Interest in deep understanding of segmentation in memory management mechanisms. 15:27: Initial boot code runs in 16-bit real mode before transitioning to protected mode. 16:02: Understanding the GDT and its role in setting up virtual addresses in protected mode. 17:24: Exploring Intel manual for detailed guidance on transitioning to protected mode. 19:07: Transition to protected mode involves setting PE flag in CR0 register and loading GDT. 19:15: Execution of 'move CR0' instruction crucial for entering protected mode. 19:26: Different requirements for switching to protected mode in N64 and i32 architectures. 19:39: Intel manual recommends steps to switch to protected mode, including disabling interrupts. 20:30: Use of AT&T syntax assembly for manipulating registers during mode switch. 20:37: 📚 Exploration of Intel manuals for protected mode initialization in kernel development 20:37: Learning about data structures like Global Descriptor Table (GDT) and Local Descriptor Table 22:20: Importance of software initialization for protected mode operation in processor 22:40: Loading minimum protected mode data structures and code modules for reliable operation 23:34: Necessity of initializing system registers before switching to protected mode 24:51: Instructions for loading GDT with Base address and executing far jumper call 27:22: Segmentation details and tasks in x86 architecture 29:01: Segment register handling after entering protected mode 30:38: Discussion on the use of TSS and tasks in kernel development 30:52: 💻 Exploring C code for printing octal numbers in a kernel environment 30:52: Understanding relationship between kernel and shared code for printing 31:46: Analyzing code structure in kernel printf.C for octal number printing 33:56: Exploring usage of callback functions for output in C printf 37:05: Modifying code fragment in print format.C for octal number conversion 38:03: Interpreting format string and implementing logic for octal conversion 39:24: Reviewing switch cases for different types of format specifiers 40:12: 🌿 Exploration of kernel functions and interfaces in C programming, focusing on CGA display driver 40:12: Discussion on accessing arguments in a printf call using VA list 41:24: Exploring the use of 'L flag' in handling various sizes in C programming 45:31: Implementation of octal character code in C programming 46:08: Explanation of the interface between printf.c and console.c in kernel development 49:02: Identification of different console types like serial console and CGA display in C programming 50:04: Analysis of the purpose of CRT size in CGA display handling 50:57: 🌱 Exploring initialization processes in kernel development, focusing on CGA display driver and memory layout customization. 50:57: Kernel initialization involves clearing BSS and setting up virtual memory. 55:59: Linker scripts help customize memory layout and export constants for C code. 57:14: Discussion on the unusual responsibility of kernel to clear BSS during initialization. 58:02: Considering alternative locations for BSS clearing such as bootloader or entry.S. 59:07: 🌿 Exploring the initialization of CGA display driver in kernel development and device access in memory. 59:07: Only one program header in the chronal binary, unlike typical binaries with multiple segments. 59:16: Speculation on the reason for single program header and potential influence of Linkerscript. 1:00:34: Discussion on debugging information and disabling stabs for successful build. 1:02:11: Limited functionalities of the kernel after initialization, focusing on console interaction. 1:03:00: Exploration of CGA initialization process and memory access for device interaction. 1:04:06: Attempt to understand memory mapping and physical address access in kernel development. 1:06:07: Analysis of device address in physical memory and its relevance in virtual memory environment. 1:07:08: Speculation on the fixed address of the device in physical memory and the need for virtual memory mapping. 1:08:05: Realization of the significance of low address access for device interaction in the kernel. 1:09:30: 🧐 Exploring memory mapping and device access in kernel development 1:09:30: Kernel has a padding zone to avoid bugs near memory border 1:10:05: Devices residing in memory require specific access, influencing memory mapping 1:12:17: Experimenting with removing unnecessary memory mapping for debugging purposes 1:13:33: Attempt to access memory without proper mapping leads to crashes 1:15:08: Using debugging tools like KGDB and GDB to analyze memory access 1:18:07: Encountering issues with memory access and seeking further information on CGA display driver 1:19:02: Attempting to learn more about CGA display driver through reference material 1:20:16: Documenting findings and preparing for further exploration in kernel development 1:26:05: 💻 Understanding the CGA display driver in kernel development through video RAM manipulation. 1:26:05: CGA text mode involves setting or clearing bits in video RAM for pixel rendering. 1:27:04: Each screen position in text mode occupies two bytes in video RAM. 1:28:05: Character attributes are defined in video RAM for text mode rendering. 1:29:36: Control registers 14 and 15 are crucial for setting cursor position in CGA display. 1:30:51: Accessing control registers involves using index and data registers through specific CPU instructions. 1:31:44: The process of writing data to screen buffer and reading it involves specific byte manipulation. 1:32:04: Interpreting data values in memory addresses requires understanding color mappings and byte representations. 1:33:09: The video explores the intricacies of CGA display driver implementation in kernel development. 1:33:47: 🌿 Exploring development of CGA display driver in x86 OS through debugging and code analysis. 1:33:47: Investigating port addresses and data manipulation for CGA initialization 1:34:13: Exploring error handling and memory management in driver development 1:35:09: Analyzing integration of keyboard and CRT in the code 1:36:57: Understanding cursor manipulation and data register operations 1:38:28: Attempting to print to serial console for debugging purposes 1:40:02: Utilizing debugger tools for code analysis and optimization 1:41:11: Learning about display driver construction and position calculation 1:42:03: Exploring 16-bit number construction and bit shifting operations 1:43:08: Engaging in OS development learning process with interest in virtual memory and hardware 1:45:01: 🧑‍💻 Discussion on debugging process, cursor position, and writing characters to display in C programming. 1:45:01: Weekly kernel development progress update 1:45:18: Storing current cursor position in local variable 1:46:04: Setting global variables to cursor position 1:46:47: Printing out cursor position using printf 1:47:36: Debugging process using GDB and print debugging 1:51:01: Discussion on writing characters to display in C 1:53:52: Issue with changing colors in display output 1:54:19: Advancing cursor position after writing data to video memory 1:55:15: Challenges with commenting out code affecting functionality 1:56:14: 🌱 Exploration of CGA display driver functionality and implementation details in C during weekly kernel development session. 1:56:14: Understanding the process of initializing CGA display driver and resolving recursive initialization issue. 1:56:23: Successful resolution of initialization issue leading to restored functionality. 1:56:40: Testing the impact of changing text color to red for a Halloween theme. 1:57:17: Learning about different text color codes and their representation. 1:58:23: Exploring the purpose of condition checking for CRT position exceeding screen size. 2:00:25: Understanding the functionality of memmove in copying text data for screen scrolling. 2:01:43: Implementing screen scrolling by moving text data up one line and clearing the last line for new text. 2:05:07: Utilizing carriage return and line feed characters to control cursor movement for new line implementation. 2:06:06: Ending the stream after two hours of productive learning and encouraging viewers to join future sessions. 2:06:36: ✌ Upcoming meeting confirmed for next time with a friendly farewell. 2:06:36: Friendly farewell 2:06:36: Meeting confirmed for next time Recapped using Tammy AI
@offlinemark
@offlinemark 18 күн бұрын
stream highlight: blue text kzbin.infoUgkxH9KmtTEmhp7K4XnIeCh0oqSnDhpSVAMe?si=YYYGNyzMLDCm5Oqb
@offlinemark
@offlinemark 18 күн бұрын
kzbin.info/www/bejne/a4LQd3yMoMeVgs0 coming back to this: it crashed because the low memory mapping is mapped non-writable, and the code tries to write there. If I map it writable, everything works.
@Arbiteroflife
@Arbiteroflife 18 күн бұрын
@44:54 I always struggle to figure out what Yak Shaving adventure is worth it vs the ROI on learning that thing just isn't worth.
@offlinemark
@offlinemark 17 күн бұрын
Yup, so true
КАХА и Джин 2
00:36
К-Media
Рет қаралды 2,2 МЛН
Stupid man 👨😂
00:20
Nadir Show
Рет қаралды 30 МЛН
How To Choose Ramen Date Night 🍜
00:58
Jojo Sim
Рет қаралды 61 МЛН
Joven bailarín noquea a ladrón de un golpe #nmas #shorts
00:17
FANG Interview Question | Process vs Thread
3:51
ByteByteGo
Рет қаралды 270 М.
Making Simple Windows Driver in C
7:26
Nir Lichtman
Рет қаралды 285 М.
Assembly Language in 100 Seconds
2:44
Fireship
Рет қаралды 1,5 МЛН
the TRUTH about C++ (is it worth your time?)
3:17
Low Level Learning
Рет қаралды 584 М.
How Does Linux Boot Process Work?
4:44
ByteByteGo
Рет қаралды 495 М.
Golang Tutorial : Go Full Course
3:49:15
Derek Banas
Рет қаралды 245 М.
Apple, как вас уделал Тюменский бренд CaseGuru? Конец удивил #caseguru #кейсгуру #наушники
0:54
CaseGuru / Наушники / Пылесосы / Смарт-часы /
Рет қаралды 4,1 МЛН
#miniphone
0:18
Miniphone
Рет қаралды 3,7 МЛН
Introducing GPT-4o
26:13
OpenAI
Рет қаралды 4,3 МЛН
How Neuralink Works 🧠
0:28
Zack D. Films
Рет қаралды 31 МЛН
iPhone green Line Issue #iphone #greenlineissue #greenline #trending
0:10
Rk Electronics Servicing Center
Рет қаралды 4,7 МЛН