Jump to content

Kernel development

14 minutes ago, Gat Pelsinger said:

Weren't you learning C a few months ago?

Had other commitments in life to do now I have more free time

 

15 minutes ago, Gat Pelsinger said:

Even if your goal is to get into operating systems, competition today is very high and it probably won't be better than Linux.

I don’t care, its not another linux distro its from scratch, I am doing it becuase I want to 

 

You sound like the guy who watches free codecamp tutorials and goes in tutorial hell no offense. 

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Nayr438 said:

Not really. The best way to learn is to start actually working on something and watch it progress, doesn't matter what it is as long as you find enjoyment out of it.

 

 

Ofc you still need to know the fundamentals of the language etc. But after that its just reading documentation and applying.

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, Nayr438 said:

Not really. The best way to learn is to start actually working on something and watch it progress, doesn't matter what it is as long as you find enjoyment out of it.

 

 

Yeah but like, I mean, like, isn't kernel development a really big goal for a C newbie? 

 

I was with a similar mindset a few years ago when I was a complete programming newbie, not that I have progressed much from that title yet. I like games so I was really turned into game development. After I completed a minor C/C++ course, I started learning OpenGL and just blindly followed one's tutorial. I gave myself credit that I at least understood what I wrote but that was way far from what a real game dev would be.

 

Today I understood how big of a jump I actually took. There is way more to it than learning some C and knowing some OpenGL commands and calling yourself a game dev. First of all, that C/C++ course was kind of a lie in which I thought I was done learning C and C++, but little did I know that I just scratched the surface. If I had at least taken some core Java or Python course, then it would have been fitting to call it a completed course, but C/C++ is extremely deep.

 

And even if I did learn some C/C++, the main parts would be data structures, algorithms and practicing problem solving. These are the stuff that actually makes you a programming rather than following some steps blindly. I didn't even know algorithms were a thing so you couldn't blame me.

 

Upon that, OpenGL is a completely different story. If I just blindly followed and understood a way of doing stuff, that is all I would know, and there will still be a really huge pile of stuff that I haven't touched which can get stuff done more efficiently.

Microsoft owns my soul.

 

Also, Dell is evil, but HP kinda nice.

Link to comment
Share on other sites

Link to post
Share on other sites

27 minutes ago, Gat Pelsinger said:

but C/C++ is extremely deep.

 

Your joking. C is one of the smallest langue's in terms of feature set, size and complexity. C++ is the thing that gets complex. Python is more complicated than C in terms of features and it being OOP. 

27 minutes ago, Gat Pelsinger said:

Yeah but like, I mean, like, isn't kernel development a really big goal for a C newbie? 

 

I have coded in other languages before and I do pen testing so I have a decent background in terms of coding/understanding stuff. 

 

27 minutes ago, Gat Pelsinger said:

I was with a similar mindset a few years ago when I was a complete programming newbie, not that I have progressed much from that title yet. I like games so I was really turned into game development. After I completed a minor C/C++ course, I started learning OpenGL and just blindly followed one's tutorial. I gave myself credit that I at least understood what I wrote but that was way far from what a real game dev would be.

 

You can't compare gaming dev to kernel dev. Game dev requires understanding of vectors, Linear algebra, Geometry, Trigonometry, Statistics, Discrete math, Applied math, and Numerical methods and a bit of calculus if your going to be making physics and a playable game(not from gui). Kernel dev requires understand of syscalls, interrupts, scheduling, virtualized memory spaces etc. If you think about it the kernel is just a application at the end of the day and it is relatively small/easy to make as long as you know what you are doing. What gets hard is making the OS, libs, gui etc. which is not in my scope at all. 

 

Put it this way if you understand the basics of C and how a kernel works its less hard than making a game. 

 

The thing that is required in all realms of programming is problem solving not necessarily being able to code some BS in 10 minutes if that makes sense. 

 

P.S sorry if I did not proof read since I was too lazy to do so...

Link to comment
Share on other sites

Link to post
Share on other sites

5 minutes ago, goatedpenguin said:

Your joking. C is one of the smallest langue's in terms of feature set, size and complexity. C++ is the thing that gets complex. Python is more complicated than C in terms of features and it being OOP.

In terms of feature set, yes, but in completeness, no, not at all. There are memory address, a lot more to pointers, very technical debugging, close relation to assembly, hexadecimal notation, pre-processor directives, manual memory management, manually coding algorithms, and a LOT of low level stuff like many low level functions (e.g. mmap) and libraries (e.g Intrinsics). Upon that, you are a real C/C++ developer if you know how functions and the language work under the hood, for example know exactly how malloc and printf work. This is what it means to learn C/C++. There is nothing like that for Java/Python, except maybe still learning about the inner workings, but not that that information would be very useful at this high level.

 

14 minutes ago, goatedpenguin said:

Put it this way if you understand the basics of C and how a kernel works its less hard than making a game.

Saying that is easy but reality is much harder. There is a reason not every ambitious low level programmer goes creating his own kernel. And honestly game dev is much easier but you still need to know about stuff.

Microsoft owns my soul.

 

Also, Dell is evil, but HP kinda nice.

Link to comment
Share on other sites

Link to post
Share on other sites

43 minutes ago, Gat Pelsinger said:

Yeah but like, I mean, like, isn't kernel development a really big goal for a C newbie?

Not really. Writing a basic kernel isn't that complicated in fact people do it all the time just look at the OSDev community.

 

2 minutes ago, Gat Pelsinger said:

And honestly game dev is much easier but you still need to know about stuff.

I would say game development is more difficult as there is a lot more you need to bring together to get to a functional state.

Link to comment
Share on other sites

Link to post
Share on other sites

18 minutes ago, Gat Pelsinger said:

There are memory address, a lot more to pointers, very technical debugging, close relation to assembly, hexadecimal notation, pre-processor directives, manual memory management, manually coding algorithms

Hexadecimal is the simplest thing, ik that when working RAM adresses etc. And wtf is manually coding algos lmao, you have to implement that everywhere if your going to use it. Preprocess directives is the stage before compilation and its for making code simpler to change and manipulating the code. You rlly don’t know what you’re talking about do you?

Link to comment
Share on other sites

Link to post
Share on other sites

54 minutes ago, Gat Pelsinger said:

There is nothing like that for Java/Python,

Each language has its own intricacies, saying that just shows that you have a superficial knowledge of both mentioned langs, and at a superficial level every language is pretty simple.

 

C and C++ are entirely different beasts when you get out of the basics and shouldn't really be mentioned as a single thing.

FX6300 @ 4.2GHz | Gigabyte GA-78LMT-USB3 R2 | Hyper 212x | 3x 8GB + 1x 4GB @ 1600MHz | Gigabyte 2060 Super | Corsair CX650M | LG 43UK6520PSA
ASUS X550LN | i5 4210u | 12GB
Lenovo N23 Yoga

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Nayr438 said:

Not really. Writing a basic kernel isn't that complicated in fact people do it all the time just look at the OSDev community.

 

I would say game development is more difficult as there is a lot more you need to bring together to get to a functional state.

I totally agree, the most difficult part (for me at least) in writing a simple kernel was just getting the toolchain set up so that I could create a bootable image. In all honesty, even that wasn't too bad.

Computer engineering grad student, machine learning researcher, and hobbyist embedded systems developer

 

Daily Driver:

CPU: Ryzen 7 4800H | GPU: RTX 2060 | RAM: 16GB DDR4 3200MHz C16

 

Gaming PC:

CPU: Ryzen 5 5600X | GPU: EVGA RTX 2080Ti | RAM: 32GB DDR4 3200MHz C16

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, dcgreen2k said:

I totally agree, the most difficult part (for me at least) in writing a simple kernel was just getting the toolchain set up so that I could create a bootable image. In all honesty, even that wasn't too bad.

The hardpart is making an entire OS that interacts with the kernel.

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, igormp said:

C and C++ are entirely different beasts

C++ is autistic(in everything except high performance computing and game dev)

Link to comment
Share on other sites

Link to post
Share on other sites

7 hours ago, Nayr438 said:

Not really. Writing a basic kernel isn't that complicated in fact people do it all the time just look at the OSDev community.

true for basic small project kernel. linux kernel with thousands of contributions and over 2 decades of history of active development is a completely different beast. 

 

On 5/11/2024 at 3:08 PM, goatedpenguin said:

Learn how a kernel works and its functions -> Need to find a source for that

A lot of the documentations are on https://www.kernel.org/, in the mailing lists, and in the code base itself. There are very few videos, books, and guides on them. There is no getting around it. In real life software engineering, engineers spend 80% of the time reading and understanding code and only 20% writing their own code on average. 

 

On 5/11/2024 at 3:08 PM, goatedpenguin said:

Read Linux system programming book -> contribute to some drivers/stuff to get a feel

yeah... you wont be able to do any of this right off the bat. in fact, even for seasoned veterans with years of coding experience, they would be very unproductive should they get onboarded onto a brand new code base/project with countless existing files and over thousands lines of code. Newly onboarded engineers and devs can take up to a year to ramp up before they can become 100% productive and able to make sweeping changes and contributions, depending on their preexisting experience and the complexities of the code base.

 

this is one reason why engineers with long tenure quitting/leaving a project can be costly and so much emphasis is placed on writing maintainable and readable code as well as code review in so many organizations. code review is partly to maintain good code quality and standard but more often, it is so other engineers can understand what you wrote and what you did so in case you end up walking out the door, these poor souls can even have a chance to pick up whatever you left behind.

 

i would advise you to follow the advice on that video. start by messing with the config file first, change/delete stuff, see what they do, and generally break things. then move on to help with QA testing the kernels, including running/updating the unit tests. finally look into bug lists/issues and from there move on to everything else, including adding new features such as the drivers you were talking about. baby steps first. 

 

also, you don't need all those books on the OS and stuffs. In college, much of the materials is about the virtual memory/paging, task scheduler and etc. these are all there in the linux kernel already. if you wanna learn about them, I would suggest you just go git clone their repo, try compiling their kernel, go to their files with all these stuffs and go about reading the code and their documentation. knowing the theory can help you understand the code better of course but the stuffs I learn from text books and classes are very surface-level stuff. i am pretty sure Linux kernels with over decades of development are very different from whatever these books taught. 

 

oh, finish reading the K&R If you haven't already. that book is seriously good. 

Sudo make me a sandwich 

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, wasab said:

yeah... you wont be able to do any of this right off the bat. in fact, even for seasoned veterans with years of coding experience, they would be very unproductive should they get onboarded onto a brand new code base/project with countless existing files and over thousands lines of code. Newly onboarded engineers and devs can take up to a year to ramp up before they can become 100% productive and able to make sweeping changes and contributions, depending on their preexisting experience and the complexities of the code base.

 

this is one reason why engineers with long tenure quitting/leaving a project can be costly and so much emphasis is placed on writing maintainable and readable code as well as code review in so many organizations. code review is partly to maintain good code quality and standard but more often, it is so other engineers can understand what you wrote and what you did so in case you end up walking out the door, these poor souls can even have a chance to pick up whatever you left behind.

 

i would advise you to follow the advice on that video. start by messing with the config file first, change/delete stuff, see what they do, and generally break things. then move on to help with QA testing the kernels, including running/updating the unit tests. finally look into bug lists/issues and from there move on to everything else, including adding new features such as the drivers you were talking about. baby steps first. 

 

also, you don't need all those books on the OS and stuffs. In college, much of the materials is about the virtual memory/paging, task scheduler and etc. these are all there in the linux kernel already. if you wanna learn about them, I would suggest you just go git clone their repo, try compiling their kernel, go to their files with all these stuffs and go about reading the code and their documentation. knowing the theory can help you understand the code better of course but the stuffs I learn from text books and classes are very surface-level stuff. i am pretty sure Linux kernels with over decades of development are very different from whatever these books taught. 

 

oh, finish reading the K&R If you haven't already. that book is seriously good. 

I guess I have to read read and read the documentation, and wdym by cfg files? specifically which ones and can you give me an example? I will also not go in tutorial hell from college courses I just want to learn these things since they are pretty important yk. And yes K&R is called the bible of C and I can see why 🙂 

Link to comment
Share on other sites

Link to post
Share on other sites

10 hours ago, goatedpenguin said:

And wtf is manually coding algos lmao

C does not provide built in data structures and algorithms like Hash Map and sorting. C++ does. Maybe I did talk a bit nonsense, but all I wanted to say is that there is a lot of low level stuff that you should know in order to call yourself a real C programmer with a chad emoji 🗿🗿.

Microsoft owns my soul.

 

Also, Dell is evil, but HP kinda nice.

Link to comment
Share on other sites

Link to post
Share on other sites

6 hours ago, Gat Pelsinger said:

but all I wanted to say is that there is a lot of low level stuff that you should know in order to call yourself a real C programmer with a chad emoji 🗿🗿.

Nobody ever mastered any programming language and, nobody can be a master at it they can be proficient and well versed in it. Sure C is one of those languages where you can cover everything since its so small but languages like C++ or java that's a wholenother story. 

6 hours ago, Gat Pelsinger said:

C does not provide built in data structures and algorithms like Hash Map and sorting.

Ik what a hashmap and sorting algos are and besides its good to know how they actually work instead of just calling on some hash function to do it for you. The reason C is so minimal is becuase you are required to do it yourself. 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×