Live data from Hacker News

Easylkb: Easy Linux Kernel Builder

tmpout.sh

21–29 of 29 posts

Re: Easylkb: Easy Linux Kernel Builder

#21
post #5

I've wanted to do some Linux kernel development for a while now, but I've never mustered the will to go through the process. This script may just be what I needed to start.

If you want to get a good introduction, I recommend the bootlin kernel course. All course material is available on their website. https://bootlin.com/training/kernel/

Thank you! This looks really good

The Linux Foundation has similar offerings but 3x more expensive, less time, and online only https://training.linuxfoundation.org/linux-kernel-developmen...

Re: Easylkb: Easy Linux Kernel Builder

#23
post #18

Ooooh this is very cute. I'm toying with building a little OS using the Linux kernel and an all-Go userspace, and one of the goals is to make the entire system as easy to cross-compile (both host OS and host/guest CPU arch) as possible. Linux being non-trivial to compile (let alone cross-compile) has been so far quite a nuissance, so I'll definitely be having a closer look at this.

The idea there sounds a lot like https://gokrazy.org/ , which builds a minimal go userland, wrapping one or more user provided go applications, and bundles in a linux kernel. Targets mostly at single board computers, and I think it downloads pre-built kernels (and bootloaters if needed), rather than trying to build them directly, since getting a working cross compilation toolchain set up and plumbed into the kernel c…

2nding gokrazy as a very nice embedded target for pi's.

Re: Easylkb: Easy Linux Kernel Builder

#24
post #18

Ooooh this is very cute. I'm toying with building a little OS using the Linux kernel and an all-Go userspace, and one of the goals is to make the entire system as easy to cross-compile (both host OS and host/guest CPU arch) as possible. Linux being non-trivial to compile (let alone cross-compile) has been so far quite a nuissance, so I'll definitely be having a closer look at this.

The idea there sounds a lot like https://gokrazy.org/ , which builds a minimal go userland, wrapping one or more user provided go applications, and bundles in a linux kernel. Targets mostly at single board computers, and I think it downloads pre-built kernels (and bootloaters if needed), rather than trying to build them directly, since getting a working cross compilation toolchain set up and plumbed into the kernel c…

Yep, both gokrazy and u-root serve as inspirations/references (there's a lot of tricky stuff like configuring the network or the framebuffer). Using a kernel from Debian while figuring out my options - glad there seem to be so many.

The ultimate goal is to make it very straightforward to change any part of the system source and try it out in action, so the only things you need installed to get started are Go and Qemu. Further down the road I'd love to extend these principles to hacking the kernel - I'd probably like a simpler kernel, maybe OpenBSD or NetBSD, but I'm less familiar with those.

Re: Easylkb: Easy Linux Kernel Builder

#25

Earlier quoted context omitted.

How relevant are these books today? They were both written in 2005.

A bit out of date, but not to the point of being useless. I still give them to juniors and interns that want to learn more about kernel work. There's also a much more recent (2022) book called Linux Device Driver Development published by packt. In general, these sorts of books are mainly useful for "what not to do", as general architecture stuff is usually well documented by source code examples and in-kernel docs.

Thanks!

Re: Easylkb: Easy Linux Kernel Builder

#26
This caught my attention because I'm obsessing about storage performance (again) and have included a kernel build in my benchmarks. I found and followed the instructions at https://wiki.debian.org/BuildADebianKernelPackage which were trivially simple.

As an aside, I was astonished that the build took less than 100s. My recollection is that this took about an hour on on my previous system (I7-4770K, 32GB RAM and SATA SSD formatted with ZFS.) New system is Ryzen 7 7700X, 32GB RAM and NVME SSD. I expected a performance boost, but not that much. I'm still wondering what I did wrong/differently.

Re: Easylkb: Easy Linux Kernel Builder

#27
post #16

I didn’t have a very hard time kernels, but building the gnu toolchain is an absolute disaster

It indeed is a journey for the most patient of us. Or, at least, was about 8 years ago, when I needed to build gcc for the Cortex M3 target. I guess not much has changed since then, and one still has a great opportunity to learn what mpfr, gmp and the rest of scary words mean, before either giving up or pushing through that crap. It's like eating super hot peppers: first one suffers, then enjoys the knowledge that they are a tough one. And maybe an endorphin rush, if they have suffered intensely enough.

Re: Easylkb: Easy Linux Kernel Builder

#28
post #27
post #16

I didn’t have a very hard time kernels, but building the gnu toolchain is an absolute disaster

It indeed is a journey for the most patient of us. Or, at least, was about 8 years ago, when I needed to build gcc for the Cortex M3 target. I guess not much has changed since then, and one still has a great opportunity to learn what mpfr, gmp and the rest of scary words mean, before either giving up or pushing through that crap. It's like eating super hot peppers: first one suffers, then enjoys the knowledge that th…

Definitely useful knowledge, but it sucks that’s what the world runs on in my opinion. It really does just need to be built from the ground up again

Re: Easylkb: Easy Linux Kernel Builder

#29
post #18

Ooooh this is very cute. I'm toying with building a little OS using the Linux kernel and an all-Go userspace, and one of the goals is to make the entire system as easy to cross-compile (both host OS and host/guest CPU arch) as possible. Linux being non-trivial to compile (let alone cross-compile) has been so far quite a nuissance, so I'll definitely be having a closer look at this.

You might enjoy looking at one of my projects, a toy Linux distro compilable from a single Makefile. https://github.com/snacsnoc/snacklinux

It uses musl and builds using a musl cross compiler, working x86 and arm64 builds. You could easily build a toolchain for your desired arch and make a simple distro, adding in any user space tools.

Post reply on HN