From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,7d661b6f053d692e X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!newsfeed.tpinternet.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mail From: Wiktor Moskwa Newsgroups: comp.lang.ada Subject: Re: Help writing ada booting kernel Date: Sun, 15 Jul 2007 14:44:49 +0000 (UTC) Organization: tp.internet - http://www.tpi.pl/ Message-ID: References: NNTP-Posting-Host: aaeq185.neoplus.adsl.tpnet.pl X-Trace: atlantis.news.tpi.pl 1184510689 29430 83.4.120.185 (15 Jul 2007 14:44:49 GMT) X-Complaints-To: usenet@tpi.pl NNTP-Posting-Date: Sun, 15 Jul 2007 14:44:49 +0000 (UTC) User-Agent: slrn/0.9.8.1 (Linux) Xref: g2news1.google.com comp.lang.ada:16476 Date: 2007-07-15T14:44:49+00:00 List-Id: On 15.07.2007, Xianzheng Zhou wrote: > I'm a new to Ada and very interested in learning this language. > Currently, I'm trying to write a small program in ada compiled by gnat, > to boot an ordinary PC, something like grub. I'm wonderring whether > ada can do this low-level task and how may I use the gnat progma to > achieve this. Please advise if you know how to do this. Hi, First of all if you want to experiment with writing a native program don't write your own bootloader, please :-) GRUB multiboot specification is a good place to start if you don't want to waste a lot of time fighting with weird x86 architecture. By learning Ada this way you will miss many features that Ada run-time provides (tasking, secondary stack, exceptions, standard library, etc.). If you still want to try, I can provide a piece of code to start with. Some time ago I wanted to experiment with native programs, you can download the results - it's a small native program that starts in protected mode, loads GDTR, enables memory paging and prints few things directly to VGA memory. It compiles with GNAT GPL and can be tested with bochs or qemu. Feel free to ask if something is not clear in the code or build script. http://hoborg.zapto.org/AdaExpOs.tgz For something serious you can check out Marte OS: http://marte.unican.es/ -- Wiktor Moskwa