On Friday 18 January 2008 10:29:23 Michael Opdenacker wrote:Personally, I'm trying to figure out how to build a "hello world" kernel. I.E. the minimal set of files I need to compile to get a kernel I can boot under qemu that does something visible. (Printing "hello world" to the serial port via the early_serial_write(), perhaps?) No VFS, no process management, preferably no memory management... Just get to a stub start_kernel() that calls early_serial_write() and then does a HLT. I note that start_kernel() calls 11 things before the first printk(), and that without the early_printk stuff that's just going into a buffer. Preferably, I even want to take this out of the kernel's build process and build it from the command line or a small shell script. (zImage packaging and all.) I.E. some kind of: gcc blah blah blah -o vmlinux wrap.sh vmlinux zImage The reason for this is, of course, that I'm trying to build the kernel with my tinycc fork, and the whole kernel build is kind of intimidating and complicated. (And I currently need to pregenerate asm-offsets.h until I teach tinycc to produce assembly output or come up with an alternative.) Currently, a "make allnoconfig" build runs for 479 lines, and builds radix tree code and /dev/random and sysfs and all sorts of stuff. Counter-intuitively, allnoconfig _isn't_ the smallest kernel you can build (by a long shot), to do that you have to switch on the embedded menu and then switch off everything in it (and all the stuff that shows up right _after_ it, which smells like a bug to me), and switch to SLOB and switch off the block layer at the top level. But doing that only gets the build down to 449 lines, and the resulting x86-64 kernel is over 400k. That is _not_ a "hello world" kernel. Not even close. :) Alas, working from the other end and building your way _up_ isn't trivial either. (But has the advantage that I'm starting much closer to my goal than the stripping down approach.) Rob -- "One of my most productive days was throwing away 1000 lines of code." - Ken Thompson. --
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| Ingo Molnar | [git pull] x86 arch updates for v2.6.25 |
| Anton Salikhmetov | [PATCH -v8 2/4] Update ctime and mtime for memory-mapped files |
git: | |
| Patrick McHardy | Re: [GIT]: Networking |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 16/37] dccp: API to query the current TX/RX CCID |
| Andrew Morton | Re: [BUG] New Kernel Bugs |
