Re: stand-alone binary

From: Norm Dresner (ndrez_at_att.net)
Date: 08/31/04


Date: Tue, 31 Aug 2004 03:11:57 GMT


"SFD" <sfd@adelphia.net> wrote in message
news:GeednYL-Q-N35a7cRVn-sg@adelphia.com...
> "Norm Dresner" <ndrez@att.net> wrote in message
> news:dyKYc.534065$Gx4.358845@bgtnsc04-news.ops.worldnet.att.net...
> > "SFD" <sfd@adelphia.net> wrote in message
> > news:S42dnfWrnLMSxK7cRVn-qQ@adelphia.com...
> > > I'm trying to create a stand-alone binary file that can be executed
> before
> > > boot.
> > >
> > > Is there a way to do this in C, or does it need to be done in
assembly?
> > >
> > > If it needs to be done in assembly, can it be assembled under Unix to
be
> > > stand-alone binary?
> > >
> > > I'd like to be able to print a simple message.
> > >
> > > Any examples, docs, references would be much appreciated.
> > >
> > > Thanks
> >
> >
> > Before boot, there is no file system so there are no shared libraries
> > available -- static linking would be your only option. Also there are
no
> OS
> > services so you don't have std-in/our/err channels either, your only
> choice
> > is to directly address the hardware which makes your program totally
> > unportable, possibly even between similar machines with different
> > accessories. It could be done in C -- a language that's often called a
> > "high-level assembly language" though much I/O may have to be done in
ASM
> if
> > your particular library doesn't provide the routines necessary to do
> direct
> > hardware I/O.
> >
> > What are you trying to do that a simple sign on the machine wouldn't
> > accomplish?
> >
> > Norm
>
> What I'm trying to do is create a boot cd and if it is in the drive when
> system boots, a message displays.
> It can either display the message or cat a text file.
>
> I found a file type that works on boot up, I just am not sure how to
create
> this type of file:
>
> # file output
> Microsoft a.out separate pure segmented standalone word-swapped V2.3
> V3.0 86 small model executable
>

Yeah, that'd probably work. I assume you're on a PC-compatible computer.
Your best bet is either an assembler or a 16-bit MS-DOS C-compiler which can
create the appropriate .COM -- but you'll have to be very careful about the
starting address because the BIOS boot loader doesn't load programs at the
same address as a normal OS does. Do you know how to make BIOS calls to
get text out?

    Norm



Relevant Pages

  • Re: Hive-Based Registry Problem!!
    ... I tried both eboot and flash boot. ... FileSystem Starting - starting with clean file system ... 0x87feb2ac: FILESYS: Restarting storage manager. ... doesn't exist for logical sector 0x0!!! ...
    (microsoft.public.windowsce.platbuilder)
  • Re: HDD down-Data Recovery Question
    ... >Windows XP could not start because the following file is missing or corrupt: ... ChkDsk is lethal in a data crisis, ... Windows can't boot without writing to the hard drive, ... - use Norton Disk Edit or similar if file system needs repair ...
    (microsoft.public.windowsxp.general)
  • Re: HDD Becoming Unstable ?
    ... Bart PE boot CDR rather than your own Windows installation. ... location on the HD, so that file system errors arise, and if the ... handling code did not properly maintain the FAT32 free space value, ... But FAT32 has far larger FATs, so this process can have a material ...
    (microsoft.public.windowsxp.general)
  • CE6.0 Hive-based registry in Hard Disk
    ... hive files in Hard Disk(FAT file system). ... ; HIVE BOOT SECTION ... FILESYS: Starting boot phase 0. ... Starting device and waiting for boot file system. ...
    (microsoft.public.windowsce.platbuilder)
  • fstab entries for external USB hard drives led to fsck.ext3 failure on boot, bug?
    ... 'F!3@$%ing fsck! ... Please repair the file system manually. ... CONTROL-D will terminate this shell and resume system boot. ... were to allow me to quickly mount an external hard drive ...
    (Debian-User)