[Freedos-kernel] SYS fix

2004-07-22 Thread Arkady V.Belousov
Hi!

 Some times I report about bugs in SYS. Unfortunately, these reports was
completely ignored. (tom, what about discussion?) Currently, I write
completely new SYS (tom, and not say later, that I not offer discussion
here!). Before this, Lucho prepares some fixes for current SYS. Below his
explanation, translated to English by me:

__O\_/_\_/O__
I fix SYS bugs, which Bart made, when joins IOCTL functions. BH register
mean lock level and should be 0 or 4, but Bart removes its zeroing, thus
LOCK disappear and MS-DOS 7.1 blocks the system. Also, in non-Watcom
function he forget to remove increment for device number. All patches and
new SYS available om my page:
http://linux.tu-varna.acad.bg/~lig/freedos/kernel/

Below patch for SYS:

diff -Naur cvs/kernel/sys/sys.c src/kernel/sys/sys.c
--- cvs/kernel/sys/sys.c2004-04-10 01:51:44.0 +0200
+++ src/kernel/sys/sys.c2004-07-21 20:28:58.0 +0200
@@ -29,7 +29,7 @@
  #define DEBUG
  /* #define DDEBUG */

-#define SYS_VERSION v3.2
+#define SYS_VERSION v3.3

  #include stdlib.h
  #include dos.h
@@ -483,13 +483,13 @@
int 0x21  \
parm [es di] [si];

-int generic_block_ioctl(unsigned char drive, unsigned cx, unsigned char
*par);
+int generic_block_ioctl(unsigned drive, unsigned cx, unsigned char *par);
  #pragma aux generic_block_ioctl = \
mov ax, 0x440d \
int 0x21 \
sbb ax, ax \
value [ax] \
-  parm [bl] [cx] [dx];
+  parm [bx] [cx] [dx]; /* BH must be 0 for lock! */

  #else

@@ -541,14 +541,14 @@
intdos(regs, regs);
  } /* reset_drive */

-int generic_block_ioctl(unsigned char drive, unsigned cx, unsigned char
*par)
+int generic_block_ioctl(unsigned drive, unsigned cx, unsigned char *par)
  {
union REGS regs;

regs.x.ax = 0x440d;
regs.x.cx = cx;
regs.x.dx = (unsigned)par;
-  regs.h.bl = drive + 1;
+  regs.h.bx = drive; /* BH must be 0 for lock! */
intdos(regs, regs);
return regs.x.cflag;
  } /* generic_block_ioctl */
@@ -692,7 +692,7 @@
  #endif

/* lock drive */
-  generic_block_ioctl((unsigned char)drive + 1, 0x84a, NULL);
+  generic_block_ioctl(drive + 1, 0x84a, NULL);

reset_drive(drive);
/* suggestion: allow reading from a boot sector or image file here */
@@ -752,7 +752,7 @@
  printf(FAT type: FAT32\n);
  /* get default bpb (but not for floppies) */
  if (drive = 2 
-generic_block_ioctl((unsigned char)drive + 1, 0x4860, default_bpb) == 0)
+generic_block_ioctl(drive + 1, 0x4860, default_bpb) == 0)
correct_bpb((struct bootsectortype *)(default_bpb + 7 - 11), bs);

  #ifdef WITHFAT32/* copy one of the FAT32 boot sectors */
@@ -767,7 +767,7 @@
{ /* copy the FAT12/16 CHS+LBA boot sector */
  printf(FAT type: FAT1%c\n, fs + '0' - 10);
  if (drive = 2 
-generic_block_ioctl((unsigned char)drive + 1, 0x860, default_bpb) == 0)
+generic_block_ioctl(drive + 1, 0x860, default_bpb) == 0)
correct_bpb((struct bootsectortype *)(default_bpb + 7 - 11), bs);
  memcpy(newboot, fs == FAT16 ? fat16com : fat12com, SEC_SIZE);
}
@@ -893,7 +893,7 @@
reset_drive(drive);

/* unlock_drive */
-  generic_block_ioctl((unsigned char)drive + 1, 0x86a, NULL);
+  generic_block_ioctl(drive + 1, 0x86a, NULL);
  } /* put_boot */
_
  O/~\ /~\O




---
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721alloc_id=10040op=click
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


Re: [Freedos-kernel] SYS fix

2004-07-22 Thread tom ehlert
Hello Arkady,

  Some times I report about bugs in SYS. Unfortunately, these reports was
 completely ignored. (tom, what about discussion?)

to make one thing clear - once and for all time:

you post about 10 changes to this list - do you really expect that
everyone reads, tries to understand, and 'discuss' this ?

as I'm not using SYS anyway, my interest in it is fairly reduced; if
it does exist at all; why should I 'discuss' that ?

I AM interested in kernel and freecom, that's enough.


 Currently, I write  completely new SYS
 (tom, and not say later, that I not offer discussion  here!).

you'll write a COMPLETELY NEW sys anyway - what's to be discussed here ?

just go ahead. but don't be surprised if noone is going to use it.

  Before this, Lucho prepares some fixes for current SYS.

I have no opinion in SYS - as long as LUCHO does them.

a) he tends to fix BUGS
b) he tends to fix them by changing 3 lines.
c) he probably tested them as well.

tom




---
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721alloc_id=10040op=click
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel