Amiga.org

Amiga computer related discussion => Amiga Software Issues and Discussion => Topic started by: fiat1100d on December 20, 2007, 12:59:01 PM

Title: Device unloading from memory
Post by: fiat1100d on December 20, 2007, 12:59:01 PM
Hello!

Is there a software for unloading devices from memory?
I mean, my Apollo 4060 board, even if it has SCSI autoboot disabled, still loads its SCSI device in memory, so software looking at those devices hangs (e.g. MakeCD).

Thanks!
Title: Re: Device unloading from memory
Post by: meega on December 20, 2007, 01:34:28 PM
"Assign ?"

It has a DISMOUNT option that can do exactly that to a system-compliant device...
Title: Re: Device unloading from memory
Post by: Piru on December 20, 2007, 01:38:38 PM
assign dismount doesn't remove the device from memory.

Scout (aminet) might (can't check right now) have it, so try that. If it helps, then it is trivial to hack a program that does it at user-startup for example.
Title: Re: Device unloading from memory
Post by: meega on December 20, 2007, 01:43:08 PM
Quote

meega wrote:
"Assign ?"

It has a DISMOUNT option that can do exactly that to a system-compliant device...


FLUSH ?
Title: Re: Device unloading from memory
Post by: Piru on December 20, 2007, 01:46:19 PM
@meega
Quote
FLUSH ?

Assign doesn't have a FLUSH option.

Assign can only unlink dosnode from dos.library internal list  (DISMOUNT). It doesn't quit the filesystem, free any memory, and it does not unlink the exec device from exec devicelist.

Title: Re: Device unloading from memory
Post by: meega on December 20, 2007, 01:47:38 PM
Beg pardon there, I am getting confused again... I've just booted the A12 and checked on Assign.. No FLUSH.

Ed: it's Avail FLUSH

So Assign to remove it from the system, and then Avail to free the memory.

You know more about the Exec side though Piru. I know little of that.
Title: Re: Device unloading from memory
Post by: Vulture on December 20, 2007, 01:54:04 PM
Like Piru said and I confirm, Scout will let you see the loaded devices and remove them from mem at will.
Title: Re: Device unloading from memory
Post by: Piru on December 20, 2007, 01:55:36 PM
Well, assign is pointless exercise as there is no dos device or volume (as far as I understood). The problem is the lame apollo scsi device-driver that barfs when programs try to probe it for (non-existant) devices.

Well behaving .device does indeed flush out of memory with Avail FLUSH, so that might work. Then again it might fail aswell, as many ROM based devices ignore expunge requests.

If it fails to remove with avail flush, then manual removal is the only option. IIRC Scout can do that. If removing with Scout works, it's rather trivial to hack a program that does the removal automagically. Something along the lines:

Code: [Select]

#include <exec/execbase.h>
#include <proto/exec.h>

extern struct ExecBase *SysBase;

int main(void)
{
  struct Node *device;
  Forbid();
  device = FindName(&SysBase->DeviceList, &quot;whatever.device&quot;);
  if (device)
  {
    Remove(device);
  }
  Permit();
  return 0;
}

The above is rather crude bruteforce solution and it doesn't free any resources taken by the driver, but it does prevent programs from seeing the device, and thus prevent them from attempting to use it.
Title: Re: Device unloading from memory
Post by: fiat1100d on December 20, 2007, 03:25:31 PM
Tried with Scout "Remove" option but the device is still there :-(

Will have to try to program an EPROM without the SCSI-Apollo.device code and check if it will boot without the device or won't boot at all.
Title: Re: Device unloading from memory
Post by: Piru on December 20, 2007, 03:36:30 PM
What is the device called exactly?
Title: Re: Device unloading from memory
Post by: fiat1100d on December 20, 2007, 03:57:27 PM
That is, scsi-apollo.device

If there was the ability of having a ROM with only 68060 compatibility code, without SCSI crap, probably most of my problems would go away.
Title: Re: Device unloading from memory
Post by: Piru on December 20, 2007, 04:01:07 PM
Try this:

remapolloscsi.exe (http://www.iki.fi/sintonen/temp/remapolloscsi.exe)
Title: Re: Device unloading from memory
Post by: fiat1100d on December 20, 2007, 04:16:06 PM
Nothing happens, the device is still there.
Could you try with SCSI-Apollo.device?

This is because I can issue, for example
version scsi-apollo.device
but then the output gives the device name as
SCSI-Apollo.device
with capital letters.
Title: Re: Device unloading from memory
Post by: fiat1100d on December 20, 2007, 04:23:36 PM
Tried to program an EPROM without a part of code which seemed to contain the SCSI device... Well the system booted but without Fast RAM too :-o

However by booting with no startup-sequence I was able to check that
version scsi-apollo.device
gives
object not found

so by having a better look at the ROM code I may be able to locate the SCSI device... Having some programming knowledge would be of some help :-D
Title: Re: Device unloading from memory
Post by: Piru on December 20, 2007, 05:03:15 PM
Get the exact name with Scout (ln_Name).
Title: Re: Device unloading from memory
Post by: fiat1100d on December 20, 2007, 05:55:32 PM
It's with capital letters:

SCSI-Apollo.device
Title: Re: Device unloading from memory
Post by: Piru on December 21, 2007, 01:00:05 AM
Binary updated.
Title: Re: Device unloading from memory
Post by: fiat1100d on December 21, 2007, 05:21:28 PM
Hey, IT JUST WORKS!

Tried it, no more Apollo's SCSI device available! MakeCD doesn't freeze!
I put it as the first line in my Startup-Sequence file :-)

Do you think it could be possible to make it "rommable", as a sort of module, for embedding into Kickstart ROM? Just an idea, don't know if it would work as it does now.

A great THANK YOU!
Title: Re: Device unloading from memory
Post by: fiat1100d on December 21, 2007, 05:36:20 PM
I think you could upload the program to Aminet, it could be useful for Apollo users which have problems with the SCSI device.
Title: Re: Device unloading from memory
Post by: mfletcher on March 27, 2012, 03:39:30 AM
Hi,

First of all, apologies for necro'ing this thread. But I just wanted to give a big thanks and a shout out to Piru for this utility.

For a while I had been trying to get my A4000 with the A4060 to recognize large hard drives. But no matter what method I tried, IDE-Fix, patched scsi.device, the A4000 would always hang on reboot.

I must have torn apart this A4000 dozens of times, thinking it was some combination of hardware( A4060, Deneb, Spectrum 24, Network card) that was causing the conflict and a hang. I had almost given up when just out the blue I tried to google Apollo 4060 and scsi.device and stumbled across this thread.

Piru, your utility works a treat. I was surprised you were still hosting it on your site after all this time. Now I can use a patched scsi.device and hopefully get large hd support working.

Thanks again,

Mark