[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] ludivmul.inc

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

22--2004 09:44 [EMAIL PROTECTED] (Bart Oldeman) wrote to
[EMAIL PROTECTED]:

  My bugfix-list for umb_init() includes 7 positions. How I may isolate
 bugfixes from new umb_init() edition?!
BO Try to optimize something else,

 ?! I _rework_ umb_init(). If its better with original edition in sense
of optimization - fine. This is only bonus. Also, as fix of bugs in
umb_init() was made some changes in other parts. For example, removed
RAM_top (both in main.c and config.c); instead (wrong!) computing of UMB_top
in umb_init(), DeviceHigh() now uses mcb_next() to compute address of next
block; etc.

 And now you offer to write from scratch third umb_init() edition, and
with this all of main.c and config.c?!

 Note: for dsk.c I was try to split changes in some (up to 10) smaller
patches - one was bugfixes, other are features, next was optimizations.
Where was your reaction for those small patches?! Null. Void. What about my
reports about bugs in SYS? Reaction - null, void. Lucho now presents quick
and dirty patches for these bugs (see previous letters), but I anyway _now_
will rewrite SYS, as there anyway _should_ be rewritten. :(

BO namely instead of how do I fix it
BO while saving as many bytes as possible in the kernel you play the game
BO how do if I fix it while saving as many lines as possible in the diff.

 I was try to do this, but even such tryings was ignored. So why I
should try to _patch_ bad code, if better to write better code?! Especially,
if it already written, works and used?!

BO Anyway, I already tried to explain you too many times, I presume it
BO doesn't help then.

PS: Let me REPEAT questions:

- What you think, if fnode will contain only f_offset (from which also may
  be computed the real relative cluster#), and change for f_offset (may be,
  except 0) will be performed by map_cluster(), which will receive new
  position through parameter (and store into f_offset after storing the
  physical cluster number in f_cluster)? (Slightly more and not urgent work
  to reduce changes of f_offset outside map_cluster(), but this should
  reduce fnode array size).

 Also, as induced by Eric:

- may be f_flags joined with f_mode (by placing F_DMOD and other such masks
  into bit 2..3 of f_mode)? And/or, f_mode and f_flags should be declared as
  UBYTE?

- may/should be `static dmatch Dmatch;' in fcbfns.c moved to stack in the
  FcbFindFirstNext() (as in other functions in fcbfns.c)?

- is this bug in dosfns.c:DosGetFree():
/* a passed nc of 0x means: skip free; see FatGetDrvData
   fcbfns.c */
if (*nc != 0x)
  *navc = (COUNT) dos_free(dpbp);
  ? What should be used instead if (*nc != 0x)? May be, if (navc)?

- initdisk.c:LBA_Get_Drive_Parameters(): isn't better to not analyze the
  .heads and .sectors fields? Isn't better to not switch to StandardBios
  (but use -1ul instead .totalSect) if .totalSectHigh is nonzero (though, it
  may be warned anyway)?

For last question tom wrote, that he was wrote (when?! where?!), that he
prefer current behavior. Which is your opinion?

PPS: Who says, that I not try to discuss changes?! I hope, above questions
will not be ignored; unfortunately, later tom again says, that I made
changes without asking. :(




---
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_idG21alloc_id040op=click
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


Re: [Freedos-kernel] Re: Smaller tour of 32bit stuff in kernel, optimize, bugs

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

22--2004 07:42 [EMAIL PROTECTED] (Eric Auer) wrote to
[EMAIL PROTECTED]:

EA So: f_dmod bug in LFN API to be fixed by Bart,

 Yes.

EA l_diroff already 16 bit but documentation erroneously still lists it as
EA 32 bit,

 Yes. But see patch from me here. After I answer to your first letter
about this, I send here at least two patches as induced by Eric.

EA I was wondering what O_LEGACY does...

 dosfns.c: O_LEGACY not called from int21/ah=6c: find right fn for
redirector. Ie., with this bit DosOpenSft() selects REM_CREATE or REM_OPEN
instead REM_EXTOC.

 EA LBA_Transfer should call the appropriate int 2f.xx function before
 EA   calling play_dj - or play_dj should call it itself: This allows
 EA   GUIs to return okay, notified, please suppress DJ text message.
EA INT 2F CU - DOS 5+ - FLOPPY-DISK LOGICAL DRIVE CHANGE NOTIFICATION
EA AX = 4A00h
EA Return: CX = h to skip Insert diskette for drive X: message
EA I think GUIs can use this: They install an handler for this function,
EA display a nice graphical something please change disks, and return
EA to DOS with no need to display the text message anymore as soon as
EA the user has confirmed the disk change. Sounds quite useful.

 More info is need: is after INT2F/4A00 with CX=-1 on exit play_dj()
should immediately return without swapping disks or only message is
supressed?

 Also, I wrote this request into todo list, but there should be checked,
how this affects DOS stacks.




---
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_idG21alloc_id040op=click
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


Re: [Freedos-kernel] Smaller tour of 32bit stuff in kernel, optimize, bugs

2004-07-22 Thread tom ehlert
Hello Arkady,

   For drives beyond lastdrive, get_cds result protects from crashes,
   but in between, access to unformatted disks returns nonsense for
   int 21.36 and even crashes while trying to do critical error dialog
te really ?
te please provide exact code sequence where it DOES return nonsense - and
te I'll fix it. (we are talking about ke2035 !!)

  Bernd and Eric many times report, that WHICHFAT utility behaves wrongly
 under FreeDOS. If you blindly ommit those reports, then this not close the
 fact, that this happens.

and why didn't you fix it long ago ?

 LBA_Get_Drive_Parameters should NOT disable LBA access if heads or
   sectors are  64k
te As I wrote this:

  WHEN

why don't you go to HISTORY.TXT ?

 AND WHERE?!

most probably in aachen, western germany, 3'rd planet in solar system

  but should be mentioned in kernel docs (- DEVICEHIGH/LOADHIGH).
te which kernel docs ?

  config.txt?

this isn't an issue of *additional, non-standard* config.sys sysntax.

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


Re: [Freedos-kernel] ludivmul.inc

2004-07-22 Thread tom ehlert
Hello Arkady,

 - may/should be `static dmatch Dmatch;' in fcbfns.c moved to stack in the
   FcbFindFirstNext() (as in other functions in fcbfns.c)?

I' abolutely NOT sure about that.

you are right - it doesn't seem to make much sense.

I have some dark memory, that I changed that (back in the dark ages),
because else the stack would overrun it's 384 byte size, and dmatch is
fairly large. please look up yourself - if that wasn't yet in ~2035,
this was the reason to make it static.


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


Re: [Freedos-kernel] Re: Smaller tour of 32bit stuff in kernel, optimize, bugs

2004-07-22 Thread tom ehlert
Hello Eric,

 EA LBA_Transfer should call the appropriate int 2f.xx function before
 EA   calling play_dj - or play_dj should call it itself: This allows
 EA   GUIs to return okay, notified, please suppress DJ text message.

 INT 2F CU - DOS 5+ - FLOPPY-DISK LOGICAL DRIVE CHANGE NOTIFICATION
 AX = 4A00h
 CX = h
 DH = new drive number
 DL = current drive number
 Return: CX = h to skip Insert diskette for drive X: message
 Note:   called by MS-DOS 5.0+ IO.SYS just before displaying the message
   Insert diskette for drive X: on single-floppy systems

these are nearly implementation instructions - I wasn't aware of this
call. you could have posted it the first time.
unfortunately AFAICS RBIL intermixed DH and DL here (it has an
advantage to be proud owner of MSDOS :)

changes needed:

hdr\pcb.h, 691
  unsigned ASMPASCAL intr(int nr, iregs * rp);

INTR.ASM, 136:

no_read_error:
ret

+   global  INTR
+INTR:
+   INTR


segment INIT_TEXT
;
 
 
DSK.C, 231

if (i == blk_dev.dh_name[0])
{
  put_string(Error in the DJ mechanism!\n);   /* should not happen! */
}
else
{ 

+   /* according to RBIL (te 22 jul 04) */
+  iregs r;
+  
+  r.a.x = 0x4a00;
+  r.c.x = 0x;
+  r.d.b.l = pddt-ddt_logdriveno;
+  r.d.b.h = pddt2-ddt_logdriveno;
+  
+  intr(0x2f,r);
+  
+  if (r.c.x == 0x) 
+   {
+   /* someone else makes a nice dialog */
+   }
+ else
+   {   
  template_string[DRIVE_POS] = 'A' + pddt2-ddt_logdriveno;
  put_string(template_string);
  put_string(Insert);
  template_string[DRIVE_POS] = 'A' + pddt-ddt_logdriveno;
  put_string(template_string + 6);
  put_string(Press the any key to continue ... \n);
  fl_readkey();
+   }  
 
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


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


Re: [Freedos-kernel] Smaller tour of 32bit stuff in kernel, optimize, bugs

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

22--2004 22:16 [EMAIL PROTECTED] (tom ehlert) wrote to Arkady V.Belousov
[EMAIL PROTECTED]:

  Bernd and Eric many times report, that WHICHFAT utility behaves wrongly
te and why didn't you fix it long ago ?

 Because not all parts of kernel is well known for me.

 LBA_Get_Drive_Parameters should NOT disable LBA access if heads or
   sectors are  64k
te As I wrote this:
  WHEN
te why don't you go to HISTORY.TXT ?

 Searching LBA_Get_Drive_Parameters inside history.txt... Not found.
Searching LBA... No mentions for suspicous values interpretation. May be,
above you was assume _when_ I wrote this _code_?

  but should be mentioned in kernel docs (- DEVICEHIGH/LOADHIGH).
te which kernel docs ?
  config.txt?
te this isn't an issue of *additional, non-standard* config.sys sysntax.

 Anyway, Eric right - FreeDOS is not enough good texts with description
of different aspects (even if texts in some aspects will duplicate Pat's
book). For example, description for memory model (including issues with
standard RTL inclusion) is a very important thing, which should be
described.

 BTW, Bart not answer, may be you: what happen when in OW will be fixed
bug with near (not far) calls to RTL functions? In this case current kernel
(with __U4M and __U4D in relocatable HMA_TEXT) will not work after
compilation.




---
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_idG21alloc_id040op=click
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


Re: [Freedos-kernel] Boot sector OEM name

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

22--2004 22:23 [EMAIL PROTECTED] (tom ehlert) wrote to Arkady V.Belousov
[EMAIL PROTECTED]:

te +  memcpy(bs-OemName, FRDOS4.1, 8);
 Otherwise, Win9x/.. will sometimes ignore boot sector BPB (yuck!).
 Value must be 5 uppercase letters, a digit (4 or 5), a dot, then a digit.
te my objection is, that we mimic dos 5.x (or better), and that it
te doesn't hurt to include the reason for change.
te so I offer
te   memcpy(bs-OemName, FRDOS5.1, 8); /* Win9x seems to require
te  5 uppercase letters,
te  digit(4 or 5) dot digit */

 Fine. Interesting, what says about this Matthias Paul?




---
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_idG21alloc_id040op=click
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


Re: [Freedos-kernel] Re: FreeCOM

2004-07-22 Thread Alain
I vote for it, please...
Alain
In other words: Only for non-multiconfig we would waste 4 bytes per environment
for the sake of being compatible to all programs! I think we *must* pay this
price, even though mathematical logics tell use the programs *should* accept
\0c:\freecom.com\0 after all.
Please re-add such a workaround (old string was PATH=.\0 I think)
instead of forcing us to upgrade all versions of FreeCOM and possibly also
other programs. I think saving four bytes of kludge RAM are not worth
forcing us all to upgrade FreeCOM.
Eric

---
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] Re: FreeCOM

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

22--2004 21:44 [EMAIL PROTECTED] (Alain) wrote to
[EMAIL PROTECTED]:

A I vote for it, please...
 Please re-add such a workaround (old string was PATH=.\0 I think)

 If you will read letters here carefull, you will see, that I already do
this.




---
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_idG21alloc_id040op=click
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel