libstartup.a

I am experimenting with producing a “roll-your-own” startup program,
and have decided to start with attempting to minimize the x86 bios startup
program. I started by copying the existing x86 bios tree to a
new directory, and running “make.” (This is BSP-6.2.0) I was
quite surprised to see that the “make” failed in its latter
stages, while running the loader, because it could not locate
a critical library. I determined that this library is (I think)
libstartup.a. I could not find this anywhere in the compile tree,
and I could not discern how to properly generate it, so I copied
it from the “prebuilt” directory tree, for now. My proximate
goal is to get a full listing of the system page.

Questions:

  1. Does anyone know how to properly make a copy of the startup library
    file libstart.a? (Execute make <??> in what directory?)
  2. Is there a straight-forward way of dumping the system page from
    a user-space program? I am attempting to use the print_syspage
    function…

Thanks!

Rich

Richard Bonomo,6289 Chamberlin,263-4683, <bonomo@sal.wisc.edu> wrote:

  1. Does anyone know how to properly make a copy of the startup library
    file libstart.a? (Execute make <??> in what directory?)

cd to “startup/lib/x86/a” and type make.

  1. Is there a straight-forward way of dumping the system page from
    a user-space program?

There’s no straight-forward way.

I am attempting to use the print_syspage function…

print_syspage can be used as a template, but you’ll have to make
reasonably extensive modifications to it.

  • kprintf => printf

  • some format strings “%l”, “%b”, “%w”, etc have to be changed

  • the code works off the temporary copy of the system page that
    startup builds before making the final copy right at the
    end. You’ll have to change all the “lsp.XXXX” references
    to “SYSPAGE_ENTRY(XXXX)” or “_syspage_ptr->XXXX” as appropriate.

  • anything else that I’ve forgotten


Brian Stecher (bstecher@qnx.com) QNX Software Systems, Ltd.
phone: +1 (613) 591-0931 (voice) 175 Terence Matthews Cr.
+1 (613) 591-3579 (fax) Kanata, Ontario, Canada K2M 1W8

Brian Stecher wrote:

Richard Bonomo,6289 Chamberlin,263-4683, <> bonomo@sal.wisc.edu> > wrote:

  1. Does anyone know how to properly make a copy of the startup library
    file libstart.a? (Execute make <??> in what directory?)

cd to “startup/lib/x86/a” and type make.

  1. Is there a straight-forward way of dumping the system page from
    a user-space program?

There’s no straight-forward way.

I am attempting to use the print_syspage function…

print_syspage can be used as a template, but you’ll have to make
reasonably extensive modifications to it.

  • kprintf => printf

  • some format strings “%l”, “%b”, “%w”, etc have to be changed

  • the code works off the temporary copy of the system page that
    startup builds before making the final copy right at the
    end. You’ll have to change all the “lsp.XXXX” references
    to “SYSPAGE_ENTRY(XXXX)” or “_syspage_ptr->XXXX” as appropriate.

  • anything else that I’ve forgotten

Thank you for the information. While I’ve got you on the

line, let me run this by you: My goal is to miminize the time
from power on to shell prompt (or whatever user-space program
is to be run). Before attmepting to tackle the BIOS proper, I
thought I would look at the IPL and startup code, as someone
had suggested to me. I have the impression that the IPL is
already pretty lean, and that there would be savings there. I am
turning my attention to the startup source to see if perhaps
some time could be saved by replacing “polling” with a fixed
table of data (for a given system), and perhaps by other ways as
well.

  1. do you think this will signficantly shorten the boot
    time on a '486?

  2. at which “dot” during the boot sequence is control likely
    to be shifted from the IPL to the startup code?

Thanks!

Rich

Richard Bonomo,6289 Chamberlin,263-4683, <bonomo@sal.wisc.edu> wrote:

Thank you for the information. While I’ve got you on the
line, let me run this by you: My goal is to miminize the time
from power on to shell prompt (or whatever user-space program
is to be run). Before attmepting to tackle the BIOS proper, I
thought I would look at the IPL and startup code, as someone
had suggested to me. I have the impression that the IPL is
already pretty lean, and that there would be savings there. I am
turning my attention to the startup source to see if perhaps
some time could be saved by replacing “polling” with a fixed
table of data (for a given system), and perhaps by other ways as
well.

  1. do you think this will signficantly shorten the boot
    time on a '486?

Nope. Typically startup takes on the order of a tenth of a second
to do it’s thing. The majority of that time is spent in the memmove
function - the one in the startup library (overriding the version
from libc) is small, but slow. Replacing the memmove with a faster
version is how you’d get the most speed up.

  1. at which “dot” during the boot sequence is control likely
    to be shifted from the IPL to the startup code?

After the last one - startup doesn’t output anything by default.
If you start putting “-v” options on, nothing is output until
startup has basically finished all it’s work.

The dot’s are done by the IPL as blocks are being read from the disk.

The overwelming percentage of time in booting a PC is waiting for
the BIOS and hardware to do their thing. Our IPL/startup/kernel init is
insignificant in comparison.


Brian Stecher (bstecher@qnx.com) QNX Software Systems, Ltd.
phone: +1 (613) 591-0931 (voice) 175 Terence Matthews Cr.
+1 (613) 591-3579 (fax) Kanata, Ontario, Canada K2M 1W8

Brian Stecher wrote:

Richard Bonomo,6289 Chamberlin,263-4683, <> bonomo@sal.wisc.edu> > wrote:
Thank you for the information. While I’ve got you on the
line, let me run this by you: My goal is to miminize the time
from power on to shell prompt (or whatever user-space program
is to be run). Before attmepting to tackle the BIOS proper, I
thought I would look at the IPL and startup code, as someone
had suggested to me. I have the impression that the IPL is
already pretty lean, and that there would be savings there. I am
turning my attention to the startup source to see if perhaps
some time could be saved by replacing “polling” with a fixed
table of data (for a given system), and perhaps by other ways as
well.

  1. do you think this will signficantly shorten the boot
    time on a '486?

Nope. Typically startup takes on the order of a tenth of a second
to do it’s thing. The majority of that time is spent in the memmove
function - the one in the startup library (overriding the version
from libc) is small, but slow. Replacing the memmove with a faster
version is how you’d get the most speed up.

  1. at which “dot” during the boot sequence is control likely
    to be shifted from the IPL to the startup code?

After the last one - startup doesn’t output anything by default.
If you start putting “-v” options on, nothing is output until
startup has basically finished all it’s work.

The dot’s are done by the IPL as blocks are being read from the disk.

The overwelming percentage of time in booting a PC is waiting for
the BIOS and hardware to do their thing. Our IPL/startup/kernel init is
insignificant in comparison.

OK, then. So my first conclusion was then, in your view, correct: that

I need to take advantage of QNX’s lack of need for a full-blown
BIOS, and swith to a no-BIOS or reduced-BIOS configuration to
signficantly reduce the time from power-on or reset to shell prompt.
Thanks! That insight is helpful. – Rich