Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Hacking OpenAI(hacktron.ai ↗)
    47comments
  2. Waymo in Singapore(waymo.com ↗)
    22comments
  3. Astra for Law(openai.com ↗)
    450comments
  4. Bonsai 2 27B: Near-Lossless Compression in a 9x Smaller Footprint(prismml.com ↗)
    108comments
  5. Bend – A language that blocks AI mistakes via proof, on CPU and GPU(bend-lang.com ↗)
    191comments
  6. Pre-Greek: The lost language hidden within Ancient Greek(linguisticdiscovery.com ↗)
    5comments
  7. Hister: A private search engine for the pages you visit and the files you keep(github.com/asciimoo ↗)
    142comments
  8. Qwen 3.8 Omni Flash(qwen.ai ↗)
    25comments
  9. Wax motor(wikipedia.org ↗)
    59comments
  10. Shapelearn Qwen 3.8 27B (13.1 GB VRAM)(byteshape.com ↗)
    2comments
  11. The Scourge of x86 Emulation(fex-emu.com ↗)
    discuss
  12. Fujitsu launches made-in-Japan next-generation CPU FUJITSU-MONAKA(global.fujitsu ↗)
    207comments
  13. Apple detectives solved mystery of ancient tree and rewrote the history of fruit(scientificamerican.com ↗)
    2comments
  14. Telstra outage: The night a network decided the year was 2006(netnod.se ↗)
    12comments
  15. Ask A Monk – A digital wilderness for thoughts with no immediate answer(askamonk.online ↗)
    12comments
  16. How to Write with an LLM(sockpuppet.org ↗)
    62comments
  17. Flet 1.0 – Build cross-platform apps in Python(flet.dev ↗)
    39comments
  18. Code Scans(devin.ai ↗)
    3comments
  19. Diplodocus, Long Thought Exclusively American, Turns Up in Spain(sci.news ↗)
    30comments
  20. The most important product decision is what you don't build(liamnugent.me ↗)
    25comments
  21. How Uber Protects Against Retry Storms(uber.com ↗)
    33comments
  22. Khipu (Quipu) Field Guide(khipufieldguide.com ↗)
    discuss
  23. CrowdSec Source Code Leak(crowdsec.net ↗)
    42comments
  24. Why I didn’t sign the Fields medallists’ letter(gowers.wordpress.com ↗)
    335comments
  25. How do we prevent mathemathics from devolving into the Medieval Era of secrecy?(mathoverflow.net ↗)
    79comments
  26. Infinite-Parameter LLMs: Generating and Adapting Weights from Live Data(arxiv.org ↗)
    38comments
  27. I Put Nam A2-Lite Inside an iRig HD X(playtaurus.com ↗)
    6comments
  28. Show HN: Snapdrop: Instantly share files between devices. No setup, no signup(snapdrop.me ↗)
    29comments
  29. The American Religion of Self-Storage Facilities(newyorker.com ↗)
    365comments
  30. Rate limits on GitLab.com are changing(about.gitlab.com ↗)
    113comments

Why Linux requires 4MB of RAM no matter of kernel size?

5 pointsby 5y ago
6 comments
Hi

I have old 386SX with 2MB of ram hanging around and I wonder:

- Why Linux requires 4MB of RAM no matter of kernel size?

- Why prior to Linux 1.3(?) I was able to use Linux with just 2MB of RAM (Slackware 2.1)

- Is it possible to modify "modern" kernel(let's say 2.4) (apart from lack of support for 386 anymore) to remove such artificial limit?

5y agoHN ↗

The base memory usage will be determined by the kernel modules loaded and the size in memory of those modules. The modules loaded will be based on the enumeration of your hardware. As kernels evolve, the hardware detected evolves and the memory allocated to support the hardware evolves too. Older kernels may have had simpler modules for your specific hardware or in some cases may not have initialized all the hardware. You can compare the output of lsmod on each kernel to compare and contrast memory usage. Other facets of memory allocation evolve over time as well, including buffer memory for things like network stack, socket management, firewall state table and related helper modules, reserved memory for paging, memory mapping of swap and more than I could list on HN. The same kernel you are using right now will have vastly different memory usage on physical bare metal vs. VM's and will vary by what devices are enumerated. Some of the older kernels (1.x) didn't even have dynamically loaded module support and may have only supported a limited set of your hardware.

The file size of the kernel will get bigger over time as more drivers are added for newer hardware. Only the drivers required for your hardware get loaded and thus the memory usage is independent of the kernels file size. If you custom build your kernel, you can strip out all of the drivers not required for your hardware if you had a need to do so. A legit need would be IoT devices that have limited persistent storage. Another use case would be if you were bored and wanted a learning exercise on building kernels or wanted to harden your kernel against specific threats or to add support for hardware without requiring a dynamically loaded module.

If you would like to get back towards a lower usage, some things you could potentially tinker with would be blacklisting drivers you do not need loaded and adjusting sysctl settings, pam limits, systemd unit file limits (does not apply to your 2.4 kernel) for more conservative memory limits based on your needs. Adjusting these things too low can cause problems or performance issues. Use care when blacklisting modules, as some modules depend on other modules and it is not always obvious why. The output of lsmod will show you some examples of the dependencies.

5y agoHN ↗

I'm sorry but that is totally not what I'm asking about.

I'm asking about the artificial HARDCODED limit despite the size of kernel or modules. This is hardcoded at boot process - no matter how big or small your kernel is.

For example my 1.1 bare-bones uncompressed kernel [just basic modules] can work at 2MB of RAM, at size of ~700kb.

Almost the same uncompressed bare-bone kernel [just basic modules] from let's say 2.4 line requires 4MB of RAM - despite very similar size (~780kb).

My question is:

- Why there is such artificial and hard-coded limit in kernel source code?

- Why it was changed from 2MB to 4MB?

- Is it possible to change it back? In kernel source this is literally just simple "if ram < 4MB then error" - without any real kernel size check.

5y agoHN ↗

Sorry I misunderstood what you were asking. The answer is, not without recompiling the kernel. CONFIG_PHYSICAL_START has changed several times from 1.x, 2.4, 2.6+ to compensate for hardware comparability issues. There are probably other offsets that have changed as well. I suspect the best place to find the all-inclusive list of changes that are required prior to recompile would be on embeded device forums.

5y agoHN ↗

It would be very hard to look into this given the high-level description. If possible, please add links to the lines of code that you are referring to.

5y agoHN ↗

The best way to see why something changed in Linux is to use git-blame and git-log. I know 1.3 and 2.4 didn't use git, but maybe there is an alternative or changelogs stored somewhere?

You could also change back to 2mb and see what explodes :)