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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham 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!news3.google.com!feeder3.cambrium.nl!feeder5.cambrium.nl!feed.tweaknews.nl!217.73.144.44.MISMATCH!ecngs!feeder.ecngs.de!news.germany.com!aioe.org!not-for-mail From: Xianzheng Zhou Newsgroups: comp.lang.ada Subject: Re: Help writing ada booting kernel Date: Mon, 16 Jul 2007 21:01:40 +1000 Organization: Aioe.org NNTP Server Message-ID: References: NNTP-Posting-Host: Brjar1TMMVF3nEKPGBV4Hg.user.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org In-Reply-To: User-Agent: Thunderbird 1.5.0.12 (X11/20070604) Xref: g2news1.google.com comp.lang.ada:16485 Date: 2007-07-16T21:01:40+10:00 List-Id: hi Wiktor, Thanks for your explanation:) I was actually trying to write a kernel like this(not grub, I used grub as an example since I need to figure out how to do standalone booting program). This is a good example exactly what I was looking for. Joe Wiktor Moskwa wrote: > On 16.07.2007, Xianzheng Zhou wrote: >> In the example, int.S and boot.S are in assembly code. Is there a way to >> write this part in Ada? >> > > In boot.S you need a way to pass values of two registers (EAX and EBX) > to the main procedure through stack - that's where Ada expects parameters. > The code in int.S can't be put in procedures because interrupt handlers > don't behave like procedures (stack frame has different format). > > If a compiler supported "bare x86" target it wouldn't probably be > a problem. For example if you compile something for AVR microcontroler > using AVR-GCC, interrupt handlers are ordinary blocks of code wrapped > in special macros - all necessary assembly code is generated by the > compiler. >