[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: BOOT?



Paul Schlyter <pausch@saaf.se> wrote:

> In article <QQ2%5.273$_q6.36346@news.uswest.net>,  <rtdos@qwest.net> wrote:
>  
> > Does anyone have any information on the Apple II/3 BOOT sectors and BOOT
> > process?

I'd suggest getting hold of Beneath Apple DOS (or Beneath Apple ProDOS)
as a good reference for this sort of low-level information.  Both of
them should be available from Byte Works <http://www.byteworks.org>.

> Basically it works like this:
>  
> 1. The PROM on the disk controller card can do two things: a) move
> the arm on the disk out to the outermost track, and b) read the
> first sector of that track to a fixed address ($300 or $800,
> depending on whether it's a 13-sector or 16-sector boot PROM)
> and then pass control to it.
>  
> 2. The code in the 1st disk sector then reads in additional sectors
> from the first track to some other fixed address.  This will read in
> the RWTS plus code which calls the RWTS to read in the remainder
> of the OS.
>  
> 3. Finally the rest of the OS can be read in, and then control
> is passed to the initialisation parts of the OS.
>  
> These steps are followed no matter what OS you're booting.

Fundamentally, yes.  The details vary between operating systems, of
course.  It is worth noting that you don't necessarily get something
with all the capabilities of RWTS after step 2.

DOS 3.3: the boot sector loads sectors 1-9, which contains all of the
code for RWTS and the third stage boot loader (ends up in $B700-$BFFF
for 48K slave DOS, or for master DOS on a 48K machine).  The third stage
loader reads in the rest of DOS (tracks 0 to 2) and transfers control to
it.

ProDOS: the boot sector loads sector 1, which consists of the second
half of block 0.  When put together with the boot ROM, there is enough
code in 512 bytes to move the head and read arbitrary blocks from the
disk.  The PRODOS file is read into memory and executed.

ProDOS's equivalent of RWTS is the 5.25" driver, which is part of the
PRODOS file (kernel).  It isn't used during the boot process, until the
kernel starts running and loads the startup application and/or other
initialization files such as ATINIT.

Pascal: I don't have the precise details, but the guts are the same as
ProDOS - load the second half of block 0, then load SYSTEM.APPLE or
SYSTEM.PASCAL into memory and jump to whichever one was loaded.

As with ProDOS, Pascal's driver for the 5.25" disk is part of the kernel
and is not used until the kernel starts to operate (after the "@" screen
flash, I think).

CP/M: never used the Apple II versions or looked at their boot code.

I haven't looked at the Apple /// boot process in detail, but I'm pretty
sure it works on the basis of the ROM loading block 1 into memory, which
then loads the SOS.KERNEL file and executes it.  I don't know how much
code is taken from the ROM and how much from block 1.

Note that SOS and PRODOS use the same file system, but have distinct
boot blocks (block 0 is for ProDOS, block 1 is for SOS).