[Freedos-kernel] patch for batch and makefiles

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

- missed one more dependency for drivers/*.asm in makefile.
- missed mention for sys/turboc.cfg and utils/tutboc.cfg.

---BeginMessage---
diff -ruNp old/drivers/makefile new/drivers/makefile
--- old/drivers/makefile2004-07-01 22:27:10.0 +
+++ new/drivers/makefile2004-07-14 18:49:34.0 +
@@ -17,7 +17,7 @@ all:  ..\lib\device.lib
-$(RM) $*.lib
$(LIBUTIL) $(LIBFLAGS) $* $(LIBOBJS) $(LIBTERM)
 
-$(OBJS):   $(DEPENDS)
+$(OBJS):   $(DEPENDS) ../kernel/segs.inc
 
 
 
diff -ruNp old/filelist new/filelist
--- old/filelist2004-07-06 01:23:04.0 +
+++ new/filelist2004-07-11 17:12:52.0 +
@@ -146,6 +146,7 @@
 */*/sys/makefile
 */*/sys/sys.c
 */*/sys/talloc.c
+*/*/sys/turboc.cfg
 */*/utils/echoto.bat
 */*/utils/exeflat.c
 */*/utils/makefile
@@ -153,3 +154,4 @@
 */*/utils/relocinf.c
 */*/utils/rmfiles.bat
 */*/utils/wlinker.bat
+*/*/utils/turboc.cfg
---End Message---


[Freedos-kernel] fix: inthndlr.c

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

- fix: (Lucho) for INT21/5F07 and 5F08, before changing bit CDSPHYSDRV,
  MS-DOS checks if physical device associated with drive letter. Without
  this check MS-FORMAT under FreeDOS was destroys RAMDISK.

---BeginMessage---
diff -ruNp old/kernel/inthndlr.c new/kernel/inthndlr.c
--- old/kernel/inthndlr.c   2004-05-30 12:31:14.0 +
+++ new/kernel/inthndlr.c   2004-07-14 23:47:40.0 +
@@ -1238,34 +1238,33 @@ dispatch:
   break;
 
 case 0x5f:
-  if (lr.AL == 7 || lr.AL == 8)
+  if (inrange(UBYTE, lr.AL, 7, 8))
   {
-struct cds FAR *cdsp;
-if (lr.DL = lastdrive)
+if (lr.DL  lastdrive)
 {
-  rc = DE_INVLDDRV;
-  goto error_exit;
-}
-cdsp = CDSp[lr.DL];
-if (lr.AL == 7)
-  cdsp-cdsFlags |= CDSPHYSDRV;
-else
-  cdsp-cdsFlags = ~CDSPHYSDRV;
-  }
-  else
-  {
-rc = (int)network_redirector_mx(REM_DOREDIRECT, lr, (void *)Int21AX);
-/* the remote function manipulates *r directly !,
-   so we should not copy lr to r here*/
-if (rc != SUCCESS)
-{
-  CritErrCode = -rc;  /* Maybe set */
-  SET_CARRY_FLAG();
+  struct cds FAR *cdsp = CDSp + lr.DL;
+  if (cdsp-cdsDpb)/* letter of physical drive?*/
+  {
+cdsp-cdsFlags = ~CDSPHYSDRV;
+if (lr.AL == 7)
+  cdsp-cdsFlags |= CDSPHYSDRV;
+break;
+  }
 }
-r-AX = -rc;
-goto real_exit;
+rc = DE_INVLDDRV;
+goto error_exit;
   }
-  break;
+
+  rc = -(int)network_redirector_mx(REM_DOREDIRECT, lr, (void *)Int21AX);
+  /* the remote function manipulates *r directly !,
+ so we should not copy lr to r here */
+  r-AX = rc;
+  if (rc != SUCCESS)
+  {
+SET_CARRY_FLAG();
+CritErrCode = rc;  /* Maybe set */
+  }
+  goto real_exit;
 
 case 0x60: /* TRUENAME */
   rc = DosTruename(MK_FP(lr.DS, lr.SI), adjust_far(FP_ES_DI));
---End Message---


[Freedos-kernel] fix: inthndlr.c

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

- fix: INT21/3301 now returns in DL low bit of input value (as in MS-DOS).

---BeginMessage---
diff -ruNp old/kernel/inthndlr.c new/kernel/inthndlr.c
--- old/kernel/inthndlr.c   2004-07-14 23:47:40.0 +
+++ new/kernel/inthndlr.c   2004-07-15 00:42:06.0 +
@@ -74,21 +74,18 @@ VOID ASMCFUNC int21_syscall(iregs FAR * 
   setvec(irp-AL, (intvec)MK_FP(irp-DS, irp-DX));
   break;
 
-  /* DosVars - get/set dos variables  */
-case 0x33:
+case 0x33: /* DosVars - get/set dos variables  */
   switch (irp-AL)
   {
-  /* Get Ctrl-C flag  */
-case 0x00:
-  irp-DL = break_ena;
-  break;
-
-  /* Set Ctrl-C flag  */
-case 0x01:
+case 0x01: /* Set Ctrl-C flag  */
   break_ena = irp-DL  1;
+  /* fall through */
+
+case 0x00: /* Get Ctrl-C flag  */
+  irp-DL = break_ena;
   break;
 
-case 0x02: /* andrew schulman: get/set extended control break  */
+case 0x02: /* andrew schulman: get/set extended control break */
   {
 UBYTE tmp = break_ena;
 break_ena = irp-DL  1;
---End Message---


[Freedos-kernel] Floppy disk read error

2004-07-14 Thread Alain
Hi Arkady,
I am experiencing a strange problem with FreeDOS, please help me because 
 I am not sure how it is happening:

K6-2 500, motherboard PcChips (SiS530) this machine works ok with 
Windows, Dos7.10 and Linux. Floppy drive is new.

Kernel 3035.
When I boot from C:, sometimes (very frequently) when I access floppy 
disk A: I get a message device not ready. I seems to be worse when I 
read 2 floppies sequentianly using a BATCH file that asks for the user 
two swap disks and pauses. Second floppy says not ready, after a few 
retries it starts working, but stops again but accepts retry. Every time 
the floppy drive led does light, I checked. If I copy the same files 
manualy (with copy a:*) it works.

The floppy is ok, I tested with scandisk on another machine. If I boot 
from floppy it seems to go ok.

I really did not understand what happens. My gess is that the floppy 
swap was not detected, but this is not 100% coherent...

please help (anyone),
Alain
---
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


[Freedos-kernel] patch: inthndlr.c

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

- callerARG1 declared as xreag instead UWORD.

---BeginMessage---
diff -ruNp old/kernel/inthndlr.c new/kernel/inthndlr.c
--- old/kernel/inthndlr.c   2004-07-15 00:42:06.0 +
+++ new/kernel/inthndlr.c   2004-07-15 02:16:58.0 +
@@ -1623,9 +1623,10 @@ STATIC VOID StartTrace(VOID)
 }
 #endif
 
-/* this function is called from an assembler wrapper function
-   and serves the internal dos calls - int2f/12xx and int2f/4a01,4a02.
+/* this function is called from an assembler wrapper function and
+   serves the internal dos calls - int2f/12xx and int2f/4a01,4a02
 */
+
 struct int2f12regs {
 #ifdef I386
 #ifdef __WATCOMC__
@@ -1644,7 +1645,7 @@ struct int2f12regs {
   UWORD di, si, bp;
   xreg b, d, c, a;
   UWORD ip, cs, flags;
-  UWORD callerARG1; /* used if called from INT2F/12 */
+  xreg callerARG1; /* used if called from INT2F/12 */
 };
 
 /* WARNING: modifications in `r' are used outside of int2F_12_handler()
@@ -1684,12 +1685,12 @@ VOID ASMCFUNC int2F_12_handler(struct in
   r.DS = FP_SEG(nul_dev);
   break;
 
-case 0x06: /* invoke critical error */
-
-  /* code, drive number, error, device header */
-  r.AL = CriticalError(r.callerARG1  8,
-   (r.callerARG1  (EFLG_CHAR  8)) ? 0 :
-   r.callerARG1  0xff, r.DI, MK_FP(r.BP, r.SI));
+case 0x06: /* invoke critical error*/
+  /* code, drive number, error, device header  */
+  r.AL = CriticalError(r.callerARG1.b.h,
+   (r.callerARG1.b.h  EFLG_CHAR)
+   ? 0 : r.callerARG1.b.l,
+  r.DI, MK_FP(r.BP, r.SI));
   break;
 
 case 0x08: /* decrease SFT reference count */
@@ -1747,19 +1748,19 @@ VOID ASMCFUNC int2F_12_handler(struct in
   break;
 }
 
-case 0x12: /* get length of asciiz string */
-
+case 0x12: /* get length of asciiz string  */
   r.CX = fstrlen(MK_FP(r.ES, r.DI)) + 1;
-
   break;
 
-case 0x13:
-  /* uppercase character */  
-  /* for now, ASCII only because nls.c cannot handle DS!=SS */
-  r.AL = (unsigned char)r.callerARG1;
-  if (r.AL = 'a'  r.AL = 'z')
-r.AL -= 'a' - 'A';
+case 0x13: /* uppercase character  */
+{
+  /* for now, ASCII only because nls.c cannot handle DS!=SS*/
+  UBYTE ch = r.callerARG1.b.l;
+  if (_islower(ch))
+ch -= (UBYTE)('a' - 'A');
+  r.AL = ch;
   break;
+}
 
 case 0x16:
   /* get address of system file table entry - used by NET.EXE
@@ -1795,10 +1796,9 @@ VOID ASMCFUNC int2F_12_handler(struct in
;
; probable use: get sizeof(CDSentry)
  */
-  {
-struct cds FAR *cdsp = get_cds(r.callerARG1  0xff);
-
-if (cdsp == NULL)
+{
+const struct cds FAR *cdsp;
+if ((cdsp = get_cds(r.callerARG1.b.l)) == NULL)
 {
   r.FLAGS |= FLG_CARRY;
   break;
@@ -1807,7 +1807,7 @@ VOID ASMCFUNC int2F_12_handler(struct in
 r.SI = FP_OFF(cdsp);
 r.FLAGS = ~FLG_CARRY;
 break;
-  }
+}
 
 case 0x18: /* get caller's registers */
 
---End Message---


Re: [Freedos-kernel] Floppy disk read error

2004-07-14 Thread Alain
A I am experiencing a strange problem with FreeDOS, please help me because
A   I am not sure how it is happening:
1. Do you test 2035a?
No, please send me the link to it. I just cannot find it.
2. Do you test FD with same conditions, as other OSes (for example, if you
   boot from diskette for FD, do you boot from diskette for MS-DOS7)?
Yes.
A When I boot from C:, sometimes (very frequently) when I access floppy
A disk A: I get a message device not ready. I seems to be worse when I
A read 2 floppies sequentianly using a BATCH file that asks for the user
A two swap disks and pauses. Second floppy says not ready, after a few
A retries it starts working, but stops again but accepts retry. Every time
A the floppy drive led does light, I checked. If I copy the same files
A manualy (with copy a:*) it works.
 This looks like hardware (floppy drive) problem (something like trouble
with head moving).
It certainly looks like, so I did all the checks including using a brand 
new driver.

It certainly is FreeDOS related. It was _much_ worse with 3034. This 
does not meen that there is not something wrong somewhere too, but other 
OS's work, maybe with an automatic retry or whatever. It is probably 
something wrong + something in FreeDOS that behaves erroniously.

A I really did not understand what happens. My gess is that the floppy
A swap was not detected, but this is not 100% coherent...
 Do you mean, that drive, probably, not senses diskette change? No, I
don't think so - with broken change line there are other simptoms.
Ok that is an old hw bug. That is not it, behaviour would be different.
The problem is that there is no debug option that could help me detect 
what is really happening. If I could understand it better, I could make 
a better test. I do have some experience, but I am lost here :(

Alain

---
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] Floppy disk read error

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

14--2004 22:41 [EMAIL PROTECTED] (Alain) wrote to
[EMAIL PROTECTED]:

 1. Do you test 2035a?
A No, please send me the link to it. I just cannot find it.

 Sources you may find at freedos.sf.net/kernel.UNSTABLE.tgz, compiled
image available at Lucho site. Also, Kenneth promise to place image on his
site www.fdos.org. If you wish, I send you may compiled edition.

  This looks like hardware (floppy drive) problem (something like trouble
 with head moving).
A It certainly looks like, so I did all the checks including using a brand
A new driver.
A It certainly is FreeDOS related. It was _much_ worse with 3034. This

 I test FreeDOS on diskette and found no issues.

A does not meen that there is not something wrong somewhere too, but other
A OS's work, maybe with an automatic retry or whatever. It is probably
A something wrong + something in FreeDOS that behaves erroniously.

 Then I can't (yet) suggest anything other here. :( FreeDOS, as other
OSes, completely BIOS-depended when accessing floppies.

A The problem is that there is no debug option that could help me detect
A what is really happening.

 You may recompile with turned DEBUGing and you get a lot of tracing
messages on screen. There are no permanently built-in debugging, which may
be turned on the fly, especially because this noticeably increases kernel.

A If I could understand it better, I could make
A a better test. I do have some experience, but I am lost here :(




---
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