comp.lang.ada
 help / color / mirror / Atom feed
From: brian <brian.catlin@gmail.com>
Subject: Re: Build raw binary on Windows
Date: Mon, 5 Apr 2010 05:01:48 -0700 (PDT)
Date: 2010-04-05T05:01:48-07:00	[thread overview]
Message-ID: <9f7d79d0-4d26-417d-ae14-19d26caa27db@z4g2000yqa.googlegroups.com> (raw)
In-Reply-To: 82aatiu17p.fsf@stephe-leake.org

On Apr 5, 9:39 am, Stephen Leake <stephen_le...@stephe-leake.org>
wrote:
> Read up on 'pragma No_Run_Time'. It's labeled obsolescent, so apparently
> there's a better way to do the same thing.

There is a new pragma, Restrictions, which provides a much finer
degree of control

> I'm not clear what you mean by "no header".

The first byte of the file is the code (i.e. no ELF or COFF
descriptors)

> You need some way to load the code into the processor. I assume you are
> first writing a boot prom, which will then load the rest of the code. So
> you need a tool that will translate the object file into hex for a prom
> burner. Gnu binutils must have that somewhere.

Jie Zhang (Code Sourcery) recommended ObjCopy (from BinUtils), which
appears to be able to take any GCC executable/object format and
convert it to any other - including just a raw binary file containing
just the code, which is exactly what I want.

The code will be written to disk.  The MBR (Master Boot Record), which
is sector 0 on a PC boot disk, is loaded and called by the BIOS when
the PC is powered-on/reset.  The partition table is also part of the
MBR, so it only leaves 440 bytes for the boot code, so I'm doing it in
multiple phases, with my MBR code (written is assembly) loading my
much larger standalone code (written in Ada).

I'm still fighting with GNAT GPL 2009 to build my standalone Ada code,
from a Windows development host.  What I need is a bare bones (no
tasking, exceptions, files, etc.) GNAT Run Time Library for x86.  I'm
going to try to create the GNAT ZFP (Zero Foot Print) RTL, but there
isn't any documentation on this (and I'm not even sure all the
necessary sources are in the GPL verrsion), so I'm flailing around a
bit.

 -Brian



  reply	other threads:[~2010-04-05 12:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-04 12:44 Build raw binary on Windows brian
2010-04-05  1:39 ` Stephen Leake
2010-04-05 12:01   ` brian [this message]
2010-04-05 12:27 ` Tero Koskinen
2010-04-05 14:06   ` brian
2010-04-05 14:30     ` Tero Koskinen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox