LKML Archive on
help / color / mirror / Atom feed
From: Rob Landley <>
Cc: Michael Opdenacker <>,
	Matt Mackall <>, Ingo Molnar <>,
	Thomas Gleixner <>,
Subject: Re: [PATCH] x86: fix	unconditional	arch/x86/kernel/pcspeaker.c?compiling
Date: Sun, 20 Jan 2008 06:25:28 -0600	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Friday 18 January 2008 10:29:23 Michael Opdenacker wrote:
> Sounds fine! Don't hesitate to let us know about the lower-hanging fruit
> you're thinking about. Here are the main things I have so far:
>     * Ideas in the existing Linux-Tiny patchset.
>     * Disable support for non-Intel processors in x86 (cyrix.c,
>       centaur.c, transmeta.c, nexgen.c, umc.c in arch/x86/kernel/cpu).
>       As far as I remember, I saved 15 KB when I first experimented with
>       this).
>     * Disable support for readahead, page writeback, pdflush and swap
>       when we have no storage at all (typically booting from an
>       initramfs). This corresponds to 69 KB of source code!
> So, more ideas are welcome!

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 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.)

> Thanks for your time,
> Michael.

"One of my most productive days was throwing away 1000 lines of code."
  - Ken Thompson.

  parent reply	other threads:[~2008-01-20 12:25 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-17 15:43 [PATCH] x86: fix unconditional arch/x86/kernel/pcspeaker.c compiling Michael Opdenacker
2008-01-17 16:36 ` Matt Mackall
2008-01-17 17:05   ` Michael Opdenacker
2008-01-17 17:13     ` Matt Mackall
2008-01-17 18:32       ` Michael Opdenacker
2008-01-17 22:15       ` Michael Opdenacker
2008-01-18  3:16         ` Taral
2008-01-18  8:22           ` Michael Opdenacker
2008-01-19  7:21             ` Taral
2008-01-18 11:02         ` [PATCH] x86: fix unconditional arch/x86/kernel/pcspeaker.c?compiling Ingo Molnar
2008-01-18 12:14           ` Michael Opdenacker
2008-01-18 12:25             ` Ingo Molnar
2008-01-18 12:29               ` Ingo Molnar
2008-01-18 13:03                 ` Michael Opdenacker
2008-01-18 13:50                   ` Matt Mackall
2008-01-18 13:57                     ` Ingo Molnar
2008-01-18 14:04                       ` Matt Mackall
2008-01-18 16:29                     ` Michael Opdenacker
2008-01-18 17:10                       ` Matt Mackall
2008-01-18 21:09                         ` Ingo Molnar
2008-01-18 22:39                           ` Matt Mackall
2008-01-22 14:39                             ` Ingo Molnar
2008-01-22 16:37                               ` Matt Mackall
2008-01-22 18:58                                 ` Sam Ravnborg
2008-01-22 19:17                                   ` Matt Mackall
2008-01-20  4:59                         ` Rob Landley
2008-01-20 16:44                           ` Matt Mackall
2008-01-21 15:31                         ` Michael Opdenacker
2008-01-23 22:30                         ` Michael Opdenacker
2008-01-24 17:09                           ` [PATCH] x86: fix?unconditional?arch/x86/kernel/pcspeaker.c?compiling Adrian Bunk
2008-01-24 20:12                           ` [PATCH] x86: fix unconditional arch/x86/kernel/pcspeaker.c?compiling Dmitri Vorobiev
2008-01-25 16:09                             ` Ralf Baechle
2008-01-20 12:25                       ` Rob Landley [this message]
2008-01-17 22:44     ` [PATCH] x86: fix unconditional arch/x86/kernel/pcspeaker.c compiling Jan Engelhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH] x86: fix	unconditional	arch/x86/kernel/pcspeaker.c?compiling' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).