Welcome, Guest. Please login or register.

Author Topic: Device unloading from memory  (Read 4304 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show all replies
    • http://www.iki.fi/sintonen/
Re: Device unloading from memory
« 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.
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show all replies
    • http://www.iki.fi/sintonen/
Re: Device unloading from memory
« Reply #1 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.

 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show all replies
    • http://www.iki.fi/sintonen/
Re: Device unloading from memory
« Reply #2 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.
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show all replies
    • http://www.iki.fi/sintonen/
Re: Device unloading from memory
« Reply #3 on: December 20, 2007, 03:36:30 PM »
What is the device called exactly?
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show all replies
    • http://www.iki.fi/sintonen/
Re: Device unloading from memory
« Reply #4 on: December 20, 2007, 04:01:07 PM »
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show all replies
    • http://www.iki.fi/sintonen/
Re: Device unloading from memory
« Reply #5 on: December 20, 2007, 05:03:15 PM »
Get the exact name with Scout (ln_Name).
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show all replies
    • http://www.iki.fi/sintonen/
Re: Device unloading from memory
« Reply #6 on: December 21, 2007, 01:00:05 AM »
Binary updated.