Mô tả

This course is designed to teach you how to create your very own multitasking operating system and kernel from scratch. It is assumed you have no experience in programming kernels and you are taught from the ground up.

Real Mode Development

Real mode is a legacy mode in all Intel processors that causes the processor to start in a legacy state, it performs like the old 8086 Intel processors did back in the way.

In the "Real Mode Development" section of the course we start by learning about the boot process and how memory works, we then move on to creating our very own boot loader that we test on our real machine! This boot loader will output a simple "Hello World!" message to the screen and we write this boot loader in purely assembly language.

In this section we also read a sector(512 bytes) from the hard disk and learn all about interrupts in real mode and how to create them.

This section gives you a nice taster into kernel development, without over whelming you with information. You are taught the basics and enough about the legacy processors to be able to move forward to more modern kernel development further into this course.

Protected Mode Development

In this section we create a 32 bit multi-tasking kernel that has the FAT16 filesystem. Our kernel will use Intel's built in memory protection and security mechanisms that allow us to instruct the processor to protect our kernel and prevent user programs from damaging it.

This section is very in depth, you are taught all about paging and virtual memory. We take advantage of clever instructions in Intel processors to allow all processes to share the same memory addresses, this is known as memory virtualization. We map memory addresses to point to different physical memory addresses to create the illusion that every process that is running is loaded at the same address. This is a very common technique in kernel development and is also how swap files work (Those files that are used to compensate for when you run out of usable RAM).

We create our own virtual filesystem layer that uses a design that is similar to the Linux kernel. This clever abstraction that will be taught to you was inspired by the instructors knowledge of writing Linux kernel drivers in his past.

You are taught about the design of the FAT16 filesystem and how the FAT16 filesystem is broken down into clusters and that they can chain together. We then implement our very own FAT16 filesystem driver allowing files to be born!

We implement functionality for tasks and processes and write our own keyboard drivers.

In this course you also get to learn how memory management works, we implement the "malloc" and "free" functions creating our very own heap that's designed to keep track of what memory is being used. Memory management is essential in any operating system and kernel.

Let us not forget that we even create an ELF file loader, we will compile all our operating systems programs into ELF files and allow the loading of binary programs or ELF programs. ELF files contain a lot of information that describes our program for example where our program should be loaded into memory and the different sections of the program.

By the end of this course you will have a fully functioning 32 bit multi-tasking kernel that can have many processes and tasks running at the same time. You will have a working shell that we can use as well.

Assembly language bonus

This is a bonus section designed to bring your assembly skills up to scratch should you struggle a little bit with the assembly language in this course. It's however advised you come to this course with experience in assembly language, we do use it and its important. Never the less if you want to take a chance on this course with no assembly experience then this section will help point you in the right direction so your able to take what you learned and apply it to the kernel.


Taught by an expert that has created Linux kernel modules professionally in the work place. 15 Years Experience As A Software Engineer

Bạn sẽ học được gì

How to create a kernel from scratch

How to create a multi-tasking kernel

How to handle malicious or problematic programs in your operating system. Terminating them if they misbehave.

How memory works in computers

The difference between kernel land, user land and the protection rings that make up modern computing

Kernel design patterns used by the Linux kernel its self

You will learn all about virtual memory and how to map virtual addresses to physical addresses

You will learn how to make the kernel understand processes and tasks

You will learn how to load ELF files

You will learn how to debug disassembled machine code

You will learn how to debug your kernel in an emulator with GDB.

Yêu cầu

  • You must know the C programming language
  • It is wise have some basic knowledge in assembly language
  • You should have a Linux operating system, free to install from the internet (We use Ubuntu in this course)

Nội dung khoá học

7 sections

Introduction

1 lectures
Introduction
04:12

Setup And A Brief Explanation Of Kernel Development

3 lectures
What Is Memory?
03:11
The Boot Process
07:05
Installing What We Need For Real Mode Development
02:30

Real Mode Development

11 lectures
Hello World Bootloader
15:51
Understanding Real Mode
04:49
Segmentation Memory Model
08:35
Improving Our Bootloader
07:30
Preparing our bootloader to be booted on real hardware
05:34
Writing our bootloader to a USB stick
02:41
Booting the bootloader
00:42
The Interrupt Vector Table Explained
03:58
Implementing our own interrupts in real mode
06:46
Disk Access And How It Works
05:43
Reading from the hard disk
13:09

Protected Mode Development

107 lectures
What is Protected Mode?
06:34
Switching To Protected Mode
15:43
Restructuring Our Project
02:19
Enabling the A20 line
02:36
Creating a Cross Compiler So We Can Code In C
11:05
Loading our 32 bit kernel into memory and working with debugging symbols
38:38
Cleaning our object files
01:23
Dealing With Alignment Issues
07:27
C Code In Protected Mode
08:03
Text Mode Explained
02:35
Writing To The Screen, Hello World Tutorial
16:26
Interrupt Descriptor Table Explained
08:32
Implementing The Interrupt Descriptor Table
27:15
Implementing In and Out Functions
09:45
Programmable Interrupt Controller Explained
04:37
Programmable Interrupt Controller Implementation
12:30
Understanding The Heap And Memory Allocation
20:23
Implementing Our Heap
01:04:41
Creating the enable interrupts function
02:48
Understanding Paging
20:01
Implementing Paging
28:15
Modifying the page table
23:02
Preparing To Read From The Hard Disk
02:45
Reading from the disk in C with the ATA controller
10:34
Improving Our Disk Driver
09:41
What is a filesystem?
07:31
Creating a path parser
36:40
Creating a disk stream
15:44
File Allocation Table Explained
18:00
Starting To Create our FAT File system
13:59
Understanding the VFS(Virtual File System) Layer
06:35
Implementing our virtual filesystem core functionality
27:29
implementing FAT16 filesystem driver core functionality
17:12
Implementing FAT16 Structures
19:18
Implementing The FAT16 Resolver Function
33:30
Implementing the VFS fopen function
24:09
Implementing FAT16 fopen function
57:01
Implementing the VFS fread function
06:06
Implementing FAT16 fread functionality
08:31
Implementing the VFS fseek functionality
02:53
Implementing the FAT16 fseek functionality
05:41
Implementing the fstat VFS functionality
04:30
Implementing the FAT16 fstat function
06:11
Implementing the VFS fclose functionality
02:34
Implementing the FAT16 fclose functionality
07:08
Implementing a kernel panic
02:14
Understanding User Land
14:54
Changing our kernel segment and data descriptors to be written in C
19:03
Implementing The TSS(Task Switch Segment)
11:58
Implementing Task Foundations
29:49
Implementing Process Foundations Part 1
38:10
Implementing Process Foundations Part 2
24:29
Packing the GDT
01:09
Implementing User Land Functionality
17:27
Creating our first user process application
09:07
Executing the process and dropping into user land privileges
07:55
Changing the paging functionality
06:14
Talking with the kernel from userland
20:14
Creating the interrupt 0x80 for user process to kernel communication
24:11
Creating the ability to create and execute kernel commands
11:17
Creating our first kernel command
10:53
Calling our kernel command
06:46
Copying strings from the tasks process
14:36
Reading the task's stack
21:08
Creating the print command in the kernel
15:00
Understanding keyboard access in protected mode
15:15
Creating the virtual keyboard layer
15:45
Creating the PS2 port keyboard driver part 1
23:23
Improving our interrupt descriptor table design
20:00
Creating a cleaner way to create interrupt handlers in the interrupt descriptor
10:18
Changing The Current Process
07:27
Creating the PS2 port keyboard driver part 2
13:34
Getting a key from the keyboard buffer in user land
10:09
Creating a putchar command that writes one character to the terminal
06:53
Implementing backspace in the terminal
03:04
Revising our stream reader
06:27
Elf Files Explained
22:10
Implementing The Elf Loader - Part 1
18:45
Implementing The Elf Loader - Part 2
23:45
Implementing The Elf Loader - Part 3
04:20
Implementing The Elf Loader - Part 4
17:12
Implementing The Elf Loader - Part 5
28:58
Implementing The Elf Loader - Part 6
13:43
Writing User Programs In C
14:49
Implementing system print in stdlib
06:25
Implementing system get key in stdlib
02:56
Implementing Malloc In Our stdlib
21:44
Implementing Free In Our stdlib
09:45
Changing the way we map virtual pages for the process
02:12
Implementing itoa function
04:45
Implementing the putchar function
07:45
Implementing the printf function
06:37
Implementing the ability to read lines
10:12
Creating a shell
09:03
Loading other programs from our shell
26:44
Creating some important stdlib functions
12:50
Memory Mapping malloc in stdlib
08:44
Memory Unmapping free In stdlib
11:06
Process arguments - Part 1
09:34
Process Arguments - Part 2
28:40
Process Arguments - Part 3
05:38
Implementing A 'System' Command
18:25
Implementing program termination
15:19
Handling program crashes
08:13
Creating an exit command
05:46
Handling caps lock, upper case and lower case letters
11:04
Running multiple tasks at the same time multi-tasking
06:44

Optional

7 lectures
README
00:34
Changing our fat16_new_fat_item_for_directory_item function
01:20
Changing our fat16_open function
03:27
Changing our fat16_get_root_directory function
02:17
Changing our process_load_binary function
02:24
Improvements to our fat16_to_proper_string function
08:21
Changing our restore_general_purpose_registers function
03:19

Assembly Language Catchup

8 lectures
Assembly Catchup!
00:09
What is assembly language?
01:47
Installing the emulator
01:33
Hello World In Assembly
17:45
Transistors And Logic Gates Understanding The Processor
12:56
Registers in the 8086
09:52
Segmentation Memory Model Explained
08:52
The Stack, Subroutines And Endiness Explained
08:37

Conclusion

1 lectures
Bonus Lecture
07:04

Đánh giá của học viên

Chưa có đánh giá
Course Rating
5
0%
4
0%
3
0%
2
0%
1
0%

Bình luận khách hàng

Viết Bình Luận

Bạn đánh giá khoá học này thế nào?

image

Đăng ký get khoá học Udemy - Unica - Gitiho giá chỉ 50k!

Get khoá học giá rẻ ngay trước khi bị fix.