From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <4A8B36B5.3050305@orcasystems.com> Date: Tue, 18 Aug 2009 16:18:13 -0700 From: James Tomaschke User-Agent: Thunderbird 2.0.0.22 (X11/20090707) MIME-Version: 1.0 To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> References: <13426df10908181026m1d977938k8c678b69878fb001@mail.gmail.com> <7d3530220908181053o7cae7f92yd0a4491db7eeef73@mail.gmail.com> <14ec7b180908181153h493b2e45y33f59d2731a6ca58@mail.gmail.com> In-Reply-To: <14ec7b180908181153h493b2e45y33f59d2731a6ca58@mail.gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [9fans] The first annual "Hello, World" challenge Topicbox-Message-UUID: 4df65d8a-ead5-11e9-9d60-3106f5b1d025 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 andrey mirtchovski wrote: > i have some variations on a theme: > > linux, i386: main() { syscall(4, 1, "hello world\n", 12); } (~6KB > dynamically linked) > linux, x86: main() { syscall(1, 1, "hello world\n", 12); } (~6KB, 4KB > stripped; 2.4megs statically linked, 400KB statically linked and > stripped) You can also use some alternative libcs for a reduced footprint, or eliminate libc altogether with some simple inline assembly. GNU is really bloated. I'm not sure where one draws the line though, theres also is a lot of code and memory behind that syscall before anything is seen on the screen, which could be considered part of the "linked" code. One could always poke data into video memory and avoid all that, but that does not get us the "Are you sure?" dialog box or status bars that go from 0 to 100% over and over again. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkqLNrUACgkQl3JZTBu3/9naawCdF9Hlx2niYJJpnbT52tLobmU6 btEAmQGuBC629h7Xx7fu6FKD8NE5yRr7 =JBrq -----END PGP SIGNATURE-----