Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.msdos.programmer > #3933 > unrolled thread

How to "Reset" an USB stick after it has been low-level changed ?

Started by"R.Wieser" <address@not.available>
First post2021-03-19 09:25 +0100
Last post2021-03-26 12:33 +0000
Articles 4 — 2 participants

Back to article view | Back to comp.os.msdos.programmer


Contents

  How to "Reset" an USB stick after it has been low-level changed ? "R.Wieser" <address@not.available> - 2021-03-19 09:25 +0100
    Re: How to "Reset" an USB stick after it has been low-level changed ? "Kerr-Mudd,John" <notsaying@127.0.0.1> - 2021-03-24 14:02 +0000
      Re: How to "Reset" an USB stick after it has been low-level changed ? "R.Wieser" <address@not.available> - 2021-03-24 17:47 +0100
        Re: How to "Reset" an USB stick after it has been low-level changed ? "Kerr-Mudd,John" <notsaying@127.0.0.1> - 2021-03-26 12:33 +0000

#3933 — How to "Reset" an USB stick after it has been low-level changed ?

From"R.Wieser" <address@not.available>
Date2021-03-19 09:25 +0100
SubjectHow to "Reset" an USB stick after it has been low-level changed ?
Message-ID<s31n76$1t6f$1@gioia.aioe.org>
Hello all,

I just read the "testing USB-ZIP images" post, and would like to ask a 
question that has some relation to it.

Some time ago on Win XP I wrote some code to make an USB stick bootable 
(either as FDD or HDD), which worked (using the DeviceIOControl function and 
stuff like IOCTL_DISK_CREATE_DISK).

The idea was that I could (re)create USB sticks to look like any old OS 
(from DOS upto W98).

The thing is I always needed to eject the stick and re-inserted it before 
being able to place files onto it (starting with MSDOS.SYS and the like), as 
I've never found how to tell the OS to re-initialize what it knew about the 
stick ...

tl;dr:
Does anyone perhaps know how programmatically to tell the OS to 
re-initialize an USB stick (so it becomes aware of newly created, removed or 
resized volumes etc.) ?

Regards,
Rudy Wieser

[toc] | [next] | [standalone]


#3934

From"Kerr-Mudd,John" <notsaying@127.0.0.1>
Date2021-03-24 14:02 +0000
Message-ID<XnsACF78EEB64D38admin127001@144.76.35.252>
In reply to#3933
On Fri, 19 Mar 2021 08:25:58 GMT, "R.Wieser" <address@not.available>
wrote: 

[]
> 
> tl;dr:
> Does anyone perhaps know how programmatically to tell the OS to 
> re-initialize an USB stick (so it becomes aware of newly created,
> removed or resized volumes etc.) ?

> 
For Windows (cmdline) there's 
RemoveDrive 
Homepage: http://www.uwe-sieber.de/drivetools_e.html
he also has a restart

Another option:
C++ code source for USB device ejecting can be had from 
http://www.withopf.com/tools/deveject/

but I don't think there's restart code in there.

-- 
Bah, and indeed, Humbug.

[toc] | [prev] | [next] | [standalone]


#3935

From"R.Wieser" <address@not.available>
Date2021-03-24 17:47 +0100
Message-ID<s3fqfc$1hkc$1@gioia.aioe.org>
In reply to#3934
John,

> For Windows (cmdline) there's
> RemoveDrive
> Homepage: http://www.uwe-sieber.de/drivetools_e.html
> he also has a restart
>
> Another option:
> C++ code source for USB device ejecting can be had from
> http://www.withopf.com/tools/deveject/

Thanks. I've downloaded the C++ code and will take a peek to see how they 
are dooing it.

> but I don't think there's restart code in there.

Maybe I've not used the right term for it..  How else can I partition a 
drive (USB or not), format it and use it directly afterwards without needing 
to restart the OS ?   As some point the OS needs to be made ware of the 
changes ...

Regards,
Rudy Wieser

[toc] | [prev] | [next] | [standalone]


#3936

From"Kerr-Mudd,John" <notsaying@127.0.0.1>
Date2021-03-26 12:33 +0000
Message-ID<XnsACF97FBE0F769admin127001@144.76.35.252>
In reply to#3935
On Wed, 24 Mar 2021 16:47:33 GMT, "R.Wieser" <address@not.available>
wrote: 

> John,
> 
>> For Windows (cmdline) there's
>> RemoveDrive
>> Homepage: http://www.uwe-sieber.de/drivetools_e.html
>> he also has a restart
>>
>> Another option:
>> C++ code source for USB device ejecting can be had from
>> http://www.withopf.com/tools/deveject/
> 
> Thanks. I've downloaded the C++ code and will take a peek to see how
> they are dooing it.
> 
>> but I don't think there's restart code in there.
> 
> Maybe I've not used the right term for it..  How else can I partition
> a drive (USB or not), format it and use it directly afterwards without
> needing to restart the OS ?   As some point the OS needs to be made
> ware of the changes ...
> 
> Regards,
> Rudy Wieser
> 
> 
Sorry I don't know.
I recall DOS's Fdisk required a reboot; I don't know about modern OS's 
(especially EUFI).

I recall that usb device driver installs required a manual "unplug & 
replug" in 2004.


> 



-- 
Bah, and indeed, Humbug.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.os.msdos.programmer


csiph-web