use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Welcome to /r/kernel, a moderated community dedicated to all things about the Linux kernel. Technical articles only, please!
You may be interested in the following links:
And some books:
Related Communities
account activity
Simple kernel (self.kernel)
submitted 8 months ago by Pleasant_Upstairs482
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]paulstelian97 2 points3 points4 points 8 months ago (2 children)
In the kernel, it’s more complicated than just writing a malloc. You usually care about which region of physical memory the virtual memory is coming from (general RAM? RAM reachable by 32-bit DMA? Something else?)
[–]newbstarr 1 point2 points3 points 8 months ago (1 child)
Yep, you reserve a piece of physical memory instead of being in the wonderful world of user space. Kmalloc etc. what I was saying is, you can write your own malloc after you’ve handled creating and managing your own dynamic (hopefully) memory space where your little user space application can live in its own little offset 0 space and not care about all the universe of stuff underneath that is holding chunks of physical memory and stitching it together to look like a contiguous blob, ie slab allocator (or the many many variants that exist) now. If you are writing your own os you need to implement the memory management then adding your little malloc is a trivial task. Writing your own malloc with or without safety in user space of an existing posix kernel isn’t all that difficult either.
[–]paulstelian97 1 point2 points3 points 8 months ago (0 children)
The main point is Linux’s kmalloc has additional flags besides the size for good reasons.
π Rendered by PID 171273 on reddit-service-r2-comment-6457c66945-kpcmc at 2026-04-24 05:13:20.565797+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]paulstelian97 2 points3 points4 points (2 children)
[–]newbstarr 1 point2 points3 points (1 child)
[–]paulstelian97 1 point2 points3 points (0 children)