Hacker News new | past | comments | ask | show | jobs | submit login
Interactive Map of Linux Kernel (makelinux.github.io)
481 points by mr_o47 on Sept 13, 2023 | hide | past | favorite | 32 comments



I LOVE this. Thank you for sharing. I want to stitch this together with my user space programs and animate it with eBPF or audit logs.

How cool would it be to have a whole map of your system blinking or changing colors based on the load to each box.

Make it 3D, put some VR goggles on and walk through your running system!


This makes me want a 3D version in the vein as SGI's fsn file manager then we'd all have an excuse to mutter "This is Linux, I know this" to ourselves.


I didn't get the reference, so I looked it up: https://en.wikipedia.org/wiki/Fsn_(file_manager)


I really should have provided a couple of refs. For anyone that doesn't get the rest of the reference: https://www.youtube.com/watch?v=dxIPcbmo1_U


Modern-ish version you can run on Linux: https://github.com/mcuelenaere/fsv


If you haven't seen Jurassic Park, you're missing out on a masterpiece.


Install fsn on Linux, navigate to /usr/src/linux .. have fun!


We’re one step closer to hacking the Gibson

https://youtu.be/b2OYNMO_mNw?si=Mg1XISFnF2DNS-ZU


Can anyone speak to how this was generated or how accurate it is? If accurate it is very impressive how liitle these lines are crossed. Also seems to be from 2010?[0]

[0] https://makelinux.wordpress.com/2010/12/20/comments-on-inter...


I work in Linux kernel related stuff, and from a brief inspection it doesn't seem like the items are terribly inaccurate, but they're not perfect. For example, kmem_cache_alloc() is listed under memory mapping, but it has nothing to do with mapping memory. It's just an API for the slab allocator which is very widespread, and also underpins kmalloc().

The bigger concern is that it doesn't seem like the map is even close to complete. For example, the VFS (virtual file system) is made up of files (open file descriptions), inodes (representing files on disk), and dentries (representing the file system tree/DAG). Probably others things I'm missing too. The area of this page describing vfs only seems to mention files and inodes, and it strangely mentions fsnotify, which is definitely an important subsystem, but not a fundamental data structure like a dentry.

I would imagine people wrote articles about topics, and they got categorized into this very cool visualization. But it's not as if it represents everything, just the things the contributors of the site were working on. It's still very cool, but don't expect that this is a comprehensive overview of the kernel, or that all the major parts of a particular area are listed here.

Edit: but that said, resources from 2010 or earlier can be quite useful. I have a cherished hard copy of Understanding the Linux Virtual Memory Manager[1] which was released in 2007 about Linux 2.4, and I regularly rely on it and its concepts. I have another beloved copy of Linux Kernel Development 3rd Ed. (2010) [2] which is how I learned a ton of fundamentals. Ultimately, it's not about the age of the resource but the concepts behind it :)

[1]: https://www.kernel.org/doc/gorman/pdf/understand.pdf [2]: https://altair.pw/pub/doc/unix/Linux%20Kernel%20Development%...



Very handy if you're already familiar with the system, but probably a little opaque for newcomers. The fact that the arrows aren't labeled (much less explained) is a bit of a let down. You kind of have to guess at what each arrow means and why. This as an Ilograph would be amazing.


I'd love to put on an exhibition of Linux running in a museum. In the centre of the room would be a computer terminal, and then there would hundreds of other screens which shows the internal state of various files and memory registers. That way people can observe parts of it as it's being used.


Previous discussion: https://news.ycombinator.com/item?id=23452721 (407 points | June 8, 2020 | 17 comments)


How was the graph made? view source did not reveal any particular framework like d3


Looks like a big SVG made with Inkscape:

    xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
And the controls seem to be made with https://github.com/timmywil/panzoom:

    <script src="https://unpkg.com/@panzoom/panzoom@4.5.1/dist/panzoom.min.js"></script>
    <script type="text/javascript">
        const panzoom = Panzoom(elem, {
            maxScale: 12
        })

        m = {
            animate: true,
            relative: true,
            maxScale: 80
        }
        right.addEventListener('click', function() {
            panzoom.pan(100, 0, m);
        })
        left.addEventListener('click', function() {
            panzoom.pan(-100, 0, m);
        })
        lu.addEventListener('click', function() {
            panzoom.pan(-100, -100, m);
        })
        up.addEventListener('click', function() {
            panzoom.pan(0, -100, m);
        })
        ru.addEventListener('click', function() {
            panzoom.pan(100, -100, m);
        })
        down.addEventListener('click', function() {
            panzoom.pan(0, 100, m);
        })
        ld.addEventListener('click', function() {
            panzoom.pan(-100, 100, m);
        })
        rd.addEventListener('click', function() {
            panzoom.pan(100, 100, m);
        })
        center.addEventListener('click', panzoom.reset)
        zoom_in.addEventListener('click', panzoom.zoomIn)
        zoom_out.addEventListener('click', panzoom.zoomOut)
        elem.parentElement.addEventListener('wheel', panzoom.zoomWithWheel)
    </script>



Do the keyboard controls work for anyone else? At least for me in current Chrome, they do not seem to work as described.


not on firefox + win10


Will this accept any codebase you throw at it? Or is it custom made for the Linux kernel?


One UX feedback: it's very hard to navigate the map when links open if you happen to pan over one. Instead, if JS is supported, links should open on click vs on release. (maybe there's a way to do it without JS too?)


Not sure if I fully understand what you mean, but...

If you hold down the <ctrl> key while you use the mouse to drag/pan/etc, it stays on the page while links open.


there are some more maps on the domain

http://www.makelinux.net/resources/ this one is shaped like a house

http://www.makelinux.net/home/


I like diagrams of code. I would like to understand Linux better.

I tried to get Linux 0.0.1 compiling. I replaced gcc with gcc -m32 and unfortunately the inline assembly constraints were invalid/impossible. Anybody have an ideas how to fix this?

I removed an unrecognised gcc flag.

I was hoping to run it in 32 bit qemu.


https://unix.stackexchange.com/questions/680335/how-to-compi... claims that it's as simple as some tiny patching, and another answer links to a github repo of interest. The funny thing is, I really thought that version of Linux used a patched gcc, but maybe I'm misremembering.


It'd be cool if there was another view that showed the relative size of each subsection, by lines of code. I don't really have an intuition about what most of the code is doing.


And it works perfectly well without JS, congratulations!

Pinch zooming makes it perfectly usable.


Mobile support sucks. But over all cool project.


This is so cool!


Where do IPC like binder fit in to this map?


It's a driver intended for use by userspace, not part of the core kernel, so it'd be a better fit on a map of Android subsystems


The same could be said about the other drivers on the map and I disagree that IPC mechanisms are not a core part of what a kernel should offer.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: