[comp.sys.amiga.programmer] Low level Hard disk drivers

ben@epmooch.UUCP (Rev. Ben A. Mesander) (03/30/91)

>In article <mykes.0866@amiga0.SF-Bay.ORG> mykes@amiga0.SF-Bay.ORG (Mike Schwartz) writes:
[rant rant rant]
>Flattery will get you everywhere.  Anyhow, Commodore does recommend 2K stacks
>in my RKMs.  I have read all the DevCon notes, and AmigaMail, too.  The OS
>does use the stack for other things.  

1.3 Includes and Autodocs, p. A-10, exec.library AddTask:
"The absolute smallest stack that is allowable is something in the range
of 100 bytes, but un general the stack size is dependent on what
subsystems are called. In general, 256 bytes is sufficient if only
exec.library is called, and 4K will do if anything in the system is
called.

Since you're all such macho programmers, and write all your own
routines, you can get by with less than 2K, I think.

>The Amiga started a whole new jargon in computer terms.  Before the Amiga,
>nobody ever heard of multimedia/desktop video.  The Amiga is also a 
>MULTIENVIRONMENT machine.  You can get Unix, MSDOS, C64, Macintosh,
>Atari ST, OS-9, MINIX, and even CP/M for it.  In this scheme of things,
>video games are their own environments.  Why do people get so down on games
>for hosing the OS when many of the other environments do?  Does a HD Installable
>game work under AMax?  Nooooo, people rave about AMax, but games sell more
>Amigas than Amax does.

Unix multitasks. MSDOS coexists with AmigaDOS. I beleive at least one
of the C-64 emulators multitasks with AmigaDOS. OS-9 multitasks. Minix
multitasks. The CP/M emulator multitasks with AmigaDOS. I'm not sure
about the Atari-ST emulators; I've never used one.

I don't own or intend to buy AMax.

--
| ben@epmooch.UUCP   (Ben Mesander)       | "Cash is more important than |
| ben%servalan.UUCP@uokmax.ecn.uoknor.edu |  your mother." - Al Shugart, |
| !chinet!uokmax!servalan!epmooch!ben     |  CEO, Seagate Technologies   |

mykes@amiga0.SF-Bay.ORG (Mike Schwartz) (03/31/91)

In article <00670283123@elgamy.RAIDERNET.COM> elg@elgamy.RAIDERNET.COM (Eric Lee Green) writes:
>From article <mykes.0470@amiga0.SF-Bay.ORG>, by mykes@amiga0.SF-Bay.ORG (Mike Schwartz):
>> I have been lobbying Commodore to solve the problem.  The problem is not with
>> the developers, but with the OS.  What I suggest CBM does is to provide entry
>> points in Exec for software that takes over the machine to access both the
>> floppy drives and the hard disks.  It is easy enough for them to do for 2.0
>> before it goes to ROM.
>
>Except that everybody's hard disk device drivers require that Exec be up
>and running. They simply WILL NOT WORK unless Exec is up and running,
>because they depend on the interrupt system, the message passing system and
>the ability to run as a separate task.
>
>> The problem with hard disk support is that it REQUIRES the OS.  Since all hard
>> disk controllers have ROM on them, the controllers could easily provide the software
>> routines needed to directly access the hard disk.  Commodore should provide routines
>> in Exec that allow AmigaDos access to the hard disk through this mechanism.  Single
>
>Excuse me, but this shows extreme ignorance of how the internals of the OS
>work. The actual dos.library was designed around the message-passing
>system... calls like Read() and Write() do not actually exist, all that
>happens is that the dos.library wraps up the request into a message packet
>and ships it off to the appropriate filesystem handler for the device in
>question. IT CANNOT WORK IF EXEC IS BOMBED!!! Period! The design of
>dos.library and the filesystem handlers is built around the message passing
>system, and you'd have to re-write them from scratch to make them work in a
>single-tasking non-Exec mode. It's like taking a Toyota Van, and trying to
>modify it to be a Toyota MR-2 sports car... you simply cannot do it. The
>beasts are too different. You'd have to re-do it from scratch (like Toyota
>did).
>

If EXEC is needed to work a hard disk, then how does AMAX do it?  Exec
does not run at the same time as AMax.  You show less understanding than you
claim I do.  Ever see DiskDoctor?  Do you think it uses AmigaDos packets to
deal with corrupted sectors on disks?  Ever see SectorX or QB Tools?  These
programs don't need nearly as much of the OS as you indicate.  These programs
could just as easily use low-level hard disk access routines as any device.

>So far, we've established that a) you don't know how AmigaDOS works, b) you
>haven't read the DevCon notes, especially the ones on how to hose the
>system such that it'd be recoverable, c)... do you even own a copy of the
>Rom Kernal manuals? You may be a great games programmer, but I get the
>impression that you don't know a whole lot about the Amiga's OS besides how
>to hose it. Times when you've said things like, "Exec needs 2K stacks
>minimum per task" are perfect proof of that... Exec *DOES* need more stack
>than your program needs for its own purposes, but that's only because when
>task switch time comes around your task's registers, 68010/68020 processor
>state, etc., are shoved onto the local stack. That data has to be stored
>*SOMEWHERE*, and if it's not stored onto the stack, it'll have to be stored
>in the task control structure somewhere. And 2K is a gross overestimate.
>

Flattery will get you everywhere.  Anyhow, Commodore does recommend 2K stacks
in my RKMs.  I have read all the DevCon notes, and AmigaMail, too.  The OS
does use the stack for other things.  

On page II-21 of AmigaMail is an article entitled "Low Level Differences
Between FFS and the ROM Filing System."  Have YOU read it?  I have.  It
explains exactly how to do what I suggest without DOS or EXEC or anything.
It does require that you use harddisk.device to read and write sectors to
the disk, and ALL I am saying is that without the OS, you can

The Amiga started a whole new jargon in computer terms.  Before the Amiga,
nobody ever heard of multimedia/desktop video.  The Amiga is also a 
MULTIENVIRONMENT machine.  You can get Unix, MSDOS, C64, Macintosh,
Atari ST, OS-9, MINIX, and even CP/M for it.  In this scheme of things,
video games are their own environments.  Why do people get so down on games
for hosing the OS when many of the other environments do?  Does a HD Installable
game work under AMax?  Nooooo, people rave about AMax, but games sell more
Amigas than Amax does.

>
>--
>Eric Lee Green   (318) 984-1820  P.O. Box 92191  Lafayette, LA 70509
>elg@elgamy.RAIDERNET.COM               uunet!mjbtn!raider!elgamy!elg
> Looking for a job... tips, leads appreciated... inquire within...

--
********************************************************
* Appendix A of the Amiga Hardware Manual tells you    *
* everything you need to know to take full advantage   *
* of the power of the Amiga.  And it is only 10 pages! *
********************************************************

theacct@bill.ucsc.edu (El hombre de pelo estranja) (03/31/91)

In article <mykes.0866@amiga0.SF-Bay.ORG> mykes@amiga0.SF-Bay.ORG (Mike Schwartz) writes:
>The Amiga started a whole new jargon in computer terms.  Before the Amiga,
>nobody ever heard of multimedia/desktop video.  The Amiga is also a 
>MULTIENVIRONMENT machine.  You can get Unix, MSDOS, C64, Macintosh,
>Atari ST, OS-9, MINIX, and even CP/M for it.  In this scheme of things,

Let's not forget,

SPECTRUM SINCLAIR

	and

APPLE II+

both are Public Domain. Well the Sinclair one requires that you supply the 
ROM code from the spectrum. 


-- 
-----------------------------------------------------------------------------
Daniel Jalkut -- Amiga guy         | "And didn't I read that these devices
snozer@toast.santa-cruz.ca.us  /// |  go two way and everything I do or say
408-429-8628 -- Day           ///  |  is goin' on a tape somewhere right now
408-423-6926 -- Night       \XX/   |  planted in my cavities?"  -- LARD
-----------------------------------------------------------------------------

ccplumb@rose.uwaterloo.ca (Colin Plumb) (04/01/91)

mykes@amiga0.SF-Bay.ORG (Mike Schwartz) wrote:
>If EXEC is needed to work a hard disk, then how does AMAX do it?  Exec
>does not run at the same time as AMax.  You show less understanding than you
>claim I do.  Ever see DiskDoctor?  Do you think it uses AmigaDos packets to
>deal with corrupted sectors on disks?  Ever see SectorX or QB Tools?  These
>programs don't need nearly as much of the OS as you indicate.  These programs
>could just as easily use low-level hard disk access routines as any device.

Actually, DiskDoctor might... there are obsolete AmigaDOS raw sector
read/write packets it might use.  But a good program is more likely
to dig through the Dos device list for the exec device name and stuff
and use that.  And the trackdisk.device, at least, uses the exec.library
and the disk.resource.  Another device driver could use anything
it damn well felt like... like SLIP to run Sun's Network Disk protocol
if it liked.  If you are as nice as possible, you can run your fancy
disk editor on that network disk.  If you hit the hardware, well, it ain't
there.

If I wanted to do what Amax does, I'd somehow make a new exec.library
(maybe stealing from the ROMs, maybe not) that let a device driver
access various utility functions, install interrupt handlers, and
access the timer.device.  As much of necessary of the above would be
rewritten not to stomp on the Mac part of memory.  Then fire up the
device driver and lie to it about what OS it's running under.
-- 
	-Colin

Tyler Sarna <tsarna@polar.bowdoin.edu> (04/04/91)

In article <13953@darkstar.ucsc.edu> of comp.sys.amiga.programmer,
El hombre de pelo estranja <theacct@bill.ucsc.edu> wrote:

> In article <mykes.0866@amiga0.SF-Bay.ORG> mykes@amiga0.SF-Bay.ORG (Mike Schwartz) writes:
> >MULTIENVIRONMENT machine.  You can get Unix, MSDOS, C64, Macintosh,
> >Atari ST, OS-9, MINIX, and even CP/M for it.  In this scheme of things,

> Let's not forget,

> APPLE II+

Anyone got a *BINARY* for the AppleII+ emulator? The source
won't compile for me...

------///------------------------------------------------------------
     /// Tyler "Ty" Sarna            E-Mail: tsarna@polar.bowdoin.edu 
 \\\///           "Heisenberg may have slept here" - Unknown
--\XX/---------------------------------------------------------------