 Hey, my name is Andrzej Langre. I'm currently working as intern in Red Hat. I'm 70 years old My experience programming took like five years now like in September. I guess I'm overclocking in an ROG Czechosy guys and Pretending some sport and the best thing I love unicorns I'm 22. I am Also a developer. I'm working in city cash for one over year, but I'm programming for eight years So let's start with operating systems So what even is operating system? Can you imagine using computer without operating system? I guess So it's Software which is loaded into computer after start PC Until it's shut down So it allows you to use PC and it's Doing base things like managing system resources, which allows you to use keyboard mouth and so on The basic layer of operating system is kernel Which do the most things With hardware Here you can see the layers of operating system which Is a user program, of course some I own management drivers Memory management the most important. I think it's process management, which allows you to managing different programs on your computer and communication with hardware Which is also important because you can't use it without this feature Well, what is the kernel? it's has a bi we which is Used for communication with application. It's not API API is provided by libraries, but API its binary interface It's not just the function, but it defines the ways how the how the arguments are provided to the kernel It can contain some hardware drivers in case of monolithic kernel in case of Microkernel, it doesn't Microkernel doesn't have drivers It has some routines It should be efficient and secure There are few types of kernel I've Told you about monolithic and Microkernel I will describe them later and it's managing resources It managing processes and so on so the first type is monolithic kernel Where it's specified that all services for from kernel are running in kernel space and It's effective effective and No, it does not limit Access to hardware When some drivers May fail the computer also shut down you can you know the BSOD blue screen of that or kernel panic it Means usually that some of your drivers will fail It can be hard to update this kernel because it contains a lot of things lot of drivers a lot of source code to update but it has got easy design and It is implementation because you don't have to care about the barrier between those layers and Microkernel This gives minimal function functional Functions for running applications or drivers Usually it doesn't contain any drivers and you are using Just to call some system functions and Those kernel is calling another drivers, but those drivers are called in user space It defines just simple abstraction some More difficult functions are in libraries which can which can be called by kernel it It's easier In a sense that it hasn't got a lot of source code but it's the But This is also the reason why we don't have here much functions but when it's when there are schools and it's calling In In a chain it can lead to some Cisco chains, which may slow down your execution and whole system So what is Cisco Cisco is? This Way for calling services from user space The reason is That we have to switch from user space kernels kernel space and Usually it's then we are software interrupt There are 256 vectors We usually there are most common interrupts for Cisco But nowadays we are calling a new new new assembler functions is entered and says exit for for going back to user space It's we have to care how the arguments are passed because as I said Kernel defines a bi not a bi Which means that we can pass arguments by registering by step or we can save them to memory on a previously specified location and And they will tell you how to start with So okay Some basically points you need to choose one language for it. We have chosen C++ It was written firstly in C, but objects are still cool. For example, Michal there is coding his own kernel in Rust So it's up to you and the platform for you are coding. So we have like two mainly platforms Which is 42 bits and 64 the the problem of The specifying the platform is that if you want to make 64 bits operating system or even just kernel you need to move or just step up to 64 bit By some layers or just some calls then the kernel type monolith microkernel or even hybrid Which is some something in between The literature you are going to study You need to get some building tools or even the chain We used G++ and there is question if it's even worth it It is Really easy answer. It's not So how to start basically coding your own kernel The main point is to boot it. So you have like At least two options of doing that using group or just coding your own bootloader Which is in a real mode in 16-bit Then you just Can start with just printing some characters to your screen Then of course clearing the characters Messing with some input and outputs. So for example input from keyboard or just output to your video memory then memory management There we have some options like heap or just paging process or task management Which is mostly should shiddling the processes and how it's executed drivers for for example a mouse or keyboard and you I where to get literature we have These many sources which is always deaf wiki or stack overflow threads. They are a lot of it You can also have a look through mining source of code, which is really cool or Some always deaf series for example to broken thorns So kernel we specify there two types of memory once physically which is basically just the RAM itself and Virtual memory, which is in protected mode the protected mode is good in for example Some tasks give its own memory and you are starting from point zero not like just One segment of memory itself and messing with it then some modularity Which is which is cool because of third party drivers. You need to implement some a bi the system calls messing with Memory management task management and your own drivers in case you have monolith kernel So task manager Do somebody Can describe what's task there? Okay, maybe cannot so the task is basically the program you are running so for example on I can run some task on Fedora, which is mostly Firefox or just a terminal Then we need to specify the difference between thread and process the difference is Process is like the task, but the process can have some threads We can we can see that for example on Google Chrome Which is running one mainly task for engine itself webkit, I guess and then for each step its own thread We can also say that process can have a lot of threads, but not in opposite way and Multitasking which is really fast switching between the tasks so you can run more really bunch huge bunch of these in same time Okay, so our kernel named puto West puto its open source kernel which was coded after open house in redhead in April to 2k18 it's coded in C++ and network byte as long bear it's monolith The platform is 42 bits. We are using grab to just Get in not implement our own bootloader, which is not cool because you need to Well, it It's not cool in the way like you need to mess with it. So it's boring as hell and Because we are using grab we can just multi boot this is some abstraction of the designs of monolith and the puto the difference between the monolith itself and puto is the we basically implement you I into kernel, but it's Gonna be more like services of the kernel and not just gys in other monoliths Kernel and the software bubble is The kernel space and user space and the difference is in user space You are running your own applications and kernel just handle it So our future plans for puto is self hosting Which means you can run something it's own file system which will which will be implemented maybe today or in some days I Hope to the end to the left corner. We have at least fat 16 May be ext4 Be more specific on GUI because now it's just some moving windows like itself some blocks not the content of of it itself built-in compilation so you can compile for it for example Firefox or etc. I want and Make some builds for a RM If you want to join us, you can just write me to get up Facebook or meet someone from Development team there or open out. Maybe we will be on the first M2, but we are not speaking there. So We can maybe move to some samples So this is basically this oh you see nothing. Sorry This is basically the sample of just When handling with keyboard It's from some previous comment on the github so I Can say there is one issue and it's buffer overflow. So If we type HV it give us a hell word because hardcoded of course, but if we just type something more we get Something like this. Yeah, and this is basically how buffer overflow looks like and Definitely our GUI of the Pluto so there is it's only VGA the resolution is For 80 pixels to 40 I guess or something like that. Oh, no This is the other one. We are 320 pixels by 200 pixels. So Because there there's issue. We've just interrupted it by VGA just itself because in this case of this resolution we can support like 256 colors and If we just shut it down and maybe turn turn off the GUI So this is basically the booting of Pluto without the GUI We have some dumps like the heap and was allocated Before we start some services like desk management or even memory management, which is now just Doing by paging Then some PCI stuff set of stuff and messing with IP addresses and ARP. So After it's done we have TCP manager and After TCP manager is in the last it just sent message on board to one two three four Like hello, I'm Pluto to TCP everywhere. So that's basically us So any questions? Whether you have some greater purpose Just for learning I Had to make some more development as my homework. So I Was interested What's beyond this? So I believe to Call home kernel, but it's a lot of work and you can you can see there are just pieces of almost everything but not Those pieces are not finished. We just wanted to try VGA palette and other things Basically, I start with the kernel development after the open house because there was workshop that there is certain Enterprise enterprise Linux, which is not booting and you need to fix it. So after like three hours I managed to fix it. So I'm quite bad in it. Maybe But Not at all. I just wanted to see more beyond Like how it really works just itself not like the user So I coded Pluto version Point 05 maybe So any other questions? It's not in the hub. It's in But I have to release new version Yesterday I made some updates to this But currently I'm not sure I want to show it because it's It's not in state it should be because it should be It should be micro-carnal not monolithic like this one In the next few days, I should do it We will put I think we will we will change with me in monolithic So, okay Well, yeah, no messing with things was the dummy box like You have some function defined in other file and so on Or just bug fixing it in Last time when you have no time for it and just Managed to copy some files to make file and then realized you implemented something But it's in the other file not in the you are compiling. So I remember I spent three days on because when the tcp tcp message is sent it would stack big it would stack because it waits for answer, but I Could I don't have didn't have set up the didn't have set up network on so it just wait and there was a Set up VGA, but not nothing was rendering and the function was in call Or just messing with the task management via which we are doing now. So the typical problem of monolithic not because we have to mess all the things if we care about VGA we Can we usually don't think that the problem is somewhere else like in tcp. That's why I spent three days And we managed to comment line which is starting the air pins communication because it's it's not important to have and It was the point. We were failing to even run it. So somewhere else maybe I Or you can just I guess Connect gdb to our virtual box machine or even the chemo and just buy some break points the bugger So, I haven't mess it with that Yeah We haven't made drivers for any special device which would need something Something More difficult Something undocumented or but the pre-documentated almost VGA could be done. We are one simple but we decided to Programmable communication Then of course you have stuck overflow. So I think that I Think we can make one last question Because you are quite running out of time I know no my micro hypervisor and you can try operating system called Jenny mode which is So which has got GUI. I think they are Basically all of all from us so See you later or if you have any more questions just find us we are mostly on Mozilla Okay