Skip to content

Commit 6a2a9e8

Browse files
author
Redirect "Slash" NIL
committed
v1.1
1 parent c7b6e68 commit 6a2a9e8

File tree

9 files changed

+1077
-7
lines changed

9 files changed

+1077
-7
lines changed

DOS+DMPI Support files/addDev.asm

Lines changed: 501 additions & 0 deletions
Large diffs are not rendered by default.

DOS+DMPI Support files/addDev.com

1.41 KB
Binary file not shown.

DOS+DMPI Support files/aspi.sys

31 KB
Binary file not shown.

DOS+DMPI Support files/cwsdpmi.exe

19.7 KB
Binary file not shown.

DOS+DMPI Support files/delDev.asm

Lines changed: 537 additions & 0 deletions
Large diffs are not rendered by default.

DOS+DMPI Support files/delDev.com

1.55 KB
Binary file not shown.

DOS+DMPI Support files/readme.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
o CWSDPMI.EXE
2+
If you compile for DOS with DJGPP, you will first need cwsdpmi.exe in
3+
the same directory where you run your executable.
4+
The default cwsdpmi tries to use your C: drive for temporary, which is
5+
rather nasty and has reportedly caused some corruption on NTFS systems.
6+
Moreover, this temp space is seldom needed. The cwsdpmi.exe provided
7+
here has the temp space disabled.
8+
o ASPI.SYS
9+
Also, you will need a DOS ASPI driver to access CD-ROM units. This
10+
driver is provided as well (OAK CD-ROM driver).
11+
o addDev/delDev
12+
Finally, rather than go through the cumbersome process of loading this
13+
driver through config.sys, the addDev utility is provided (with source)
14+
You can load the aspi.sys driver (or any other driver) at any time by
15+
using the command:
16+
addDev ASPI.SYS
17+
The delDev counterpart is also provided.

changelog.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1+
v1.1 - o Improved Linux support:
2+
Recent versions of the Linux kernel do sgio passthru natively, and cancel the
3+
need for the SCSI generic module and /dev/sg#
4+
For instance, you can now access a /dev/hdc DVD-ROM directly
5+
sgioReadName() was modified accordingly for proper scanning of these devices.
6+
o DOS/DPMI support files now included (for DJGPP users)
7+
18
v1.0 - first release

sgio.cpp

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@
5353

5454
#endif
5555

56-
#define MAX_DEV_SG 29 /* tbd: what number is beyond the last of "/dev/sg*"? */
56+
#define MAX_DEV_HD 20 /* hda -> hdt */
57+
#define MAX_DEV_SG 17 /* sg0 -> sg16 */
58+
#define MAX_DEV_SCD 16 /* scd0 -> scd15 */
5759

5860
/**
5961
** Describe a Linux ioctl SG_IO connection to a device.
@@ -548,9 +550,7 @@ int sgioGetSense(Sgio * sgio, char * chars, int charsLength, int elseLength)
548550
/**
549551
** Read the first else the next well known device path name.
550552
**
551-
** That is, read names from the list:
552-
**
553-
** /dev/sg0 /dev/sg1 /dev/sg2 .. /dev/sg$MAX_DEV_SG
553+
** UPDATED: Recent Linux kernel handle standard devices as SGIO ones
554554
**
555555
** Copy a name of up to charsLength to the chars.
556556
**
@@ -570,16 +570,24 @@ int sgioReadName(Sgio * sgio, char * chars, int charsLength)
570570
/* Return negative after the last name. */
571571

572572
int readNameInt = sgio->theReadNameInt;
573-
if (MAX_DEV_SG < readNameInt) return -1;
573+
if ((MAX_DEV_HD+MAX_DEV_SG+MAX_DEV_SCD) <= readNameInt) return -1;
574574

575575
/* Read a "/dev/sg$number" name. */
576576

577577
sgio->theReadNameInt = (readNameInt + 1);
578578

579579
/* Print the name. */
580580

581-
char name[] = "/dev/sg9876543210";
582-
(void) sprintf(&name[0], "/dev/sg%ld", (long) readNameInt);
581+
char name[] = "/dev/hda876543210";
582+
if (readNameInt < MAX_DEV_HD)
583+
{
584+
name[7] += readNameInt;
585+
name[8] = 0;
586+
}
587+
else if ((readNameInt - MAX_DEV_HD) < MAX_DEV_SG)
588+
(void) sprintf(&name[0], "/dev/sg%ld", (long) (readNameInt - MAX_DEV_HD));
589+
else
590+
(void) sprintf(&name[0], "/dev/scd%ld", (long) (readNameInt - MAX_DEV_HD - MAX_DEV_SG));
583591

584592
/* Copy the name if it fits. */
585593

0 commit comments

Comments
 (0)