SCSI pass thru - Linux, Win NT/2K/XP 
Author Message
 SCSI pass thru - Linux, Win NT/2K/XP


> Subject: Re: to GForth add .c by shortest path ...
> By the way, passing SCSI thru GForth might be easy.

Yep, SCSI pass through GForth is easy, thanks again all you GForth

> http://www.*-*-*.com/ (~ 14 KiB)
> now appears to pass SCSI CDB's and double-buffered
> Data thru Win NT/ 2K/ XP.

http://www.*-*-*.com/ (~ 20 KiB)
now passes SCSI thru Linux too (i.e. via sg 3 since Linux 2.4).  The is just 6,907 bytes, though surely you can and should rebuild
your own .so with Linux gcc, and you need a copy of
gforth-0.5.0/lib.fs or equivalent.

We could do Win 95/98/ME and/or Dos next, if anyone cares, a la:
http://www.*-*-*.com/ +windows

> ...

Run this code at only your own risk, and edit and run it only at more
of your own risk.

Me, I think of this as code that should demand root privilege to run.
But to my dismay, I find that my Knoppix Linux does require the `sudo`
prefix for `umount`, yet not for this.  So you could abuse this to
eject a disk that hasn't been unmounted - potentially destroying all
the data of the disk, sometimes even the disk itself.

An example use is reading the Lba 0 of a DVD/CD:

        include lscsi.fs

        dev x] 28 0 00 00 00 00 0 00 01 0 x[ 800 Hi
        cr . data 800 dump
        dev clo

Note I am assuming the conventional x800 bytes per block for DVD/CD,
x200 bytes per block for HDD.  Bad Things Happen if/when these
assumptions fail.

Again I say: "This is of course Not Safe, on at least Two counts.  1)
Newbie code which can read ..., if only slightly buggy, can
occasionally write ... too ([perhaps] instantly losing all the data
[stored in a PC], whoops).  2)" And in Linux, if you just want to read
and write, rather than sampling device ID's and ejecting CD's and
polling buttons and so on, surely you'd rather just open the device as
a file.

Pat LaVarre

P.S. Last I checked, Mac OS X can't do "sg" without adding a kernel

Tue, 20 Sep 2005 09:48:01 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Upcoming Windows XP replaces win ME and 2k This looks bad don't it

2. Line drawing characters under NT/2K/XP

3. How to compile GNU Prolog on Windows NT/2K/XP

4. LFN for Win-NT/2k

5. CVF serial port routines under Win NT/2K

6. passing args via command line on win xp

7. Serial port problems(?) in XP&2K

8. Serial port problems(?) in XP&2K

9. 2K/XP - How to get CPU frequency ?

10. Link86 and WinNT/2K/XP

11. Network problem with Win Xp and Win 98

12. Win 2000 and Win XP


Powered by phpBB® Forum Software