Re: [Freedos-kernel] PATCH: config.c

2004-06-29 Thread Arkady V.Belousov
Hi!

29-Июн-2004 23:23 [EMAIL PROTECTED] (Eduardo Casino) wrote to
[EMAIL PROTECTED]:

>> - source: (Bernd) the codepage table rewritten into a smaller layout.
>> - bugfix: (Bernd, Aitor) country ID for Spain set to 34 (instead 33).
EC> I'm sorry, I missed this post. I see it now in the archives.

 Unfortunately, all of this currently in hands of limited number of
peoples, I don't sure in perspectives of my work. :(




---
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


Re: [Freedos-kernel] PATCH: config.c

2004-06-29 Thread Eduardo Casino
> __O\_/_\_/O__
> - source: (Bernd) the codepage table rewritten into a smaller layout.
> - bugfix: (Bernd, Aitor) country ID for Spain set to 34 (instead 33).
> _

I'm sorry, I missed this post. I see it now in the archives.
Eduardo.



---
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


Re: [Freedos-kernel] PATCH: config.c

2004-06-29 Thread Bernd Blaauw
Eduardo Casino schreef:
Hi!
Country code for Spain is 34, not 33.
Eduardo.
 

fixed in Arkady's version, and please check your clock - it's 23:15 here 
and your message is dated 30-06-2004 00:21 or so.
one hour too much.

thanks for the patch though :)
Bernd
---
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


Re: [Freedos-kernel] PATCH: config.c

2004-06-29 Thread Arkady V.Belousov
Hi!

30-Июн-2004 00:21 [EMAIL PROTECTED] (Eduardo Casino) wrote to
[EMAIL PROTECTED]:

EC> Country code for Spain is 34, not 33.
EC>/* Spain */ ,{
EC> -33, /*  = W1 W437   # Country ID & Codepage */
EC> +34, /*  = W1 W437   # Country ID & Codepage */

__O\_/_\_/O__
- source: (Bernd) the codepage table rewritten into a smaller layout.
- bugfix: (Bernd, Aitor) country ID for Spain set to 34 (instead 33).
_
  O/~\ /~\O




---
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


[Freedos-kernel] PATCH: config.c

2004-06-29 Thread Eduardo Casino
Hi!

Country code for Spain is 34, not 33.

Eduardo.


diff -uNrp ke2035.orig/kernel/config.c ke2035/kernel/config.c
--- ke2035.orig/kernel/config.c 2004-06-24 13:41:15.0 +0200
+++ ke2035/kernel/config.c  2004-06-30 00:16:03.0 +0200
@@ -2120,7 +2120,7 @@ struct CountrySpecificInfo specificCount
   }
   
   /* Spain */ ,{
-33, /*  = W1 W437   # Country ID & Codepage
*/
+34, /*  = W1 W437   # Country ID & Codepage
*/
 850,  
 _DATE_DMY,  /*Date format: 0/1/2:
U.S.A./Europe/Japan */
 "EUR",  /* '$' ,'EUR'   */




---
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


Re: [Freedos-kernel] patch: config.c

2004-05-09 Thread Arkady V.Belousov
Hi!

9-Май-2004 22:08 [EMAIL PROTECTED] (Bart Oldeman) wrote to
[EMAIL PROTECTED]:

>>  This is tradeoff (you reduce code, data may be increased). On the other
>> side, after this patch (unpacked) executable increased only by 2 bytes.
BO> This is strange:
BO> TGROUP  -11 bytes
BO> ICONST  -34 bytes
BO> IDATA  +128 bytes
BO> total   +83.
BO> But part of the ICONST reduction comes from the removal of "COMMAND" so that
BO> doesn't count in the final comparison.

 Of course. But I count "COMMAND" as part of this patch. :)




---
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver
higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


Re: [Freedos-kernel] patch: config.c

2004-05-09 Thread Bart Oldeman
On Mon, 10 May 2004, Arkady V.Belousov wrote:

> 9-íÁÊ-2004 21:15 [EMAIL PROTECTED] (Bart Oldeman) wrote to
> [EMAIL PROTECTED]:
>
> >> - small optimization: `init' and `inittail' now "assigned" to .cfgInit and
> >>   .cfgInitTail statically.
> >> - removed "COMMAND" statement.
> >> TGROUP reduced from 0e1d1h to 0e1c6h;
> >> INIT_TEXT reduced from 3b71h to 3b66h;
> >> ICONST reduced from 9b8h to 996h;
> >> I_BSS reduced from 0e7ch to 0df6h;
> >> IDATA increased from 57ah to 5fah.
> BO> I don't think it's good to reduce BSS at the cost of DATA. Some people
> BO> like uncompressed kernels to be as small as possible too and the BSS
> BO> isn't showing up in kernel.sys :)
>
>  This is tradeoff (you reduce code, data may be increased). On the other
> side, after this patch (unpacked) executable increased only by 2 bytes.

This is strange:
TGROUP  -11 bytes
ICONST  -34 bytes
IDATA  +128 bytes

total   +83.

But part of the ICONST reduction comes from the removal of "COMMAND" so that
doesn't count in the final comparison.

Bart



---
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver
higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


Re: [Freedos-kernel] patch: config.c

2004-05-09 Thread Arkady V.Belousov
Hi!

9-Май-2004 21:15 [EMAIL PROTECTED] (Bart Oldeman) wrote to
[EMAIL PROTECTED]:

>> - small optimization: `init' and `inittail' now "assigned" to .cfgInit and
>>   .cfgInitTail statically.
>> - removed "COMMAND" statement.
>> TGROUP reduced from 0e1d1h to 0e1c6h;
>> INIT_TEXT reduced from 3b71h to 3b66h;
>> ICONST reduced from 9b8h to 996h;
>> I_BSS reduced from 0e7ch to 0df6h;
>> IDATA increased from 57ah to 5fah.
BO> I don't think it's good to reduce BSS at the cost of DATA. Some people
BO> like uncompressed kernels to be as small as possible too and the BSS
BO> isn't showing up in kernel.sys :)

 This is tradeoff (you reduce code, data may be increased). On the other
side, after this patch (unpacked) executable increased only by 2 bytes.
Moreover, later .cfgInit _array_ may be joined with .cfgInitTail _array_
into one, twice lesser array (with .cfgInitTail as pointer inside this
common array), thus you get bigger reduction.

BO> (except for MSVC) Even for compressed kernels having all zeros at the
BO> end helps: less entropy.




---
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver
higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


Re: [Freedos-kernel] patch: config.c

2004-05-09 Thread Bart Oldeman
On Sun, 9 May 2004, Arkady V.Belousov wrote:

> - small optimization: `init' and `inittail' now "assigned" to .cfgInit and
>   .cfgInitTail statically.
> - removed "COMMAND" statement.
>
> TGROUP reduced from 0e1d1h to 0e1c6h;
> INIT_TEXT reduced from 3b71h to 3b66h;
> ICONST reduced from 9b8h to 996h;
> I_BSS reduced from 0e7ch to 0df6h;
> IDATA increased from 57ah to 5fah.

I don't think it's good to reduce BSS at the cost of DATA. Some people
like uncompressed kernels to be as small as possible too and the BSS
isn't showing up in kernel.sys :) (except for MSVC)

Even for compressed kernels having all zeros at the end helps: less
entropy.

Bart



---
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver
higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel


[Freedos-kernel] patch: config.c

2004-05-09 Thread Arkady V.Belousov
Hi!

- small optimization: `init' and `inittail' now "assigned" to .cfgInit and
  .cfgInitTail statically.
- removed "COMMAND" statement.

TGROUP reduced from 0e1d1h to 0e1c6h;
INIT_TEXT reduced from 3b71h to 3b66h;
ICONST reduced from 9b8h to 996h;
I_BSS reduced from 0e7ch to 0df6h;
IDATA increased from 57ah to 5fah.

PS: Later `init' and `inittail' may be integrated back to Config structure,
thus removing extra pointers - just remove `cmd' in main.c:kernel() and
manipulate .cfgInitTail there directly.
--- Begin Message ---
diff -ruNp old/kernel/config.c new/kernel/config.c
--- old/kernel/config.c 2004-04-14 07:04:08.0 +
+++ new/kernel/config.c 2004-05-09 23:29:48.0 +
@@ -125,6 +125,9 @@ static UBYTE ErrorAlreadyPrinted[128] BS
 char master_env[128] BSS_INIT({0});
 static char *envp = master_env;
 
+static char init[NAMEMAX] = "command.com";
+static char inittail[NAMEMAX] = " /P /E:256\r\n";
+
 struct config Config = {
   0,
   NUMBUFF,
@@ -132,8 +135,8 @@ struct config Config = {
   0,
   NFCBS,
   0,
-  "command.com",
-  " /P /E:256\r\n",
+  init,
+  inittail,
   NLAST,
   0,
   NSTACKS,
@@ -267,7 +270,6 @@ STATIC struct table commands[] = {
 
   {"BREAK", 1, CfgBreak},
   {"BUFFERS", 1, Config_Buffers},
-  {"COMMAND", 1, InitPgm},
   {"COUNTRY", 1, Country},
   {"DOS", 1, Dosmem},
   {"DOSDATA", 1, DosData},
@@ -1237,12 +1239,6 @@ STATIC VOID InitPgmHigh(BYTE * pLine)
 
 STATIC VOID InitPgm(BYTE * pLine)
 {
-  static char init[NAMEMAX];
-  static char inittail[NAMEMAX];
-
-  Config.cfgInit = init;
-  Config.cfgInitTail = inittail;
-
   /* Get the string argument that represents the new init pgm */
   pLine = GetStringArg(pLine, Config.cfgInit);
 
@@ -1723,8 +1719,8 @@ STATIC void config_init_buffers(int want
 
   LoL->firstbuf = pbuffer;
 
-  DebugPrintf(("init_buffers (size %u) at", sizeof(struct buffer)));
-  DebugPrintf((" (%p)", LoL->firstbuf));
+  DebugPrintf(("init_buffers (size %u) at (%p)",
+   sizeof(struct buffer), pbuffer));
 
   buffers--;
   pbuffer->b_prev = FP_OFF(pbuffer + buffers);
--- End Message ---


[Freedos-kernel] patch: config.c (repost)

2004-03-24 Thread Arkady V.Belousov
--- Begin Message ---
diff -ruNp OLD/kernel/config.c NEW/kernel/config.c
--- OLD/kernel/config.c 2004-01-31 15:06:36.0 +
+++ NEW/kernel/config.c 2004-03-25 00:42:36.0 +
@@ -922,12 +922,8 @@ STATIC void Config_Buffers(BYTE * pLine)
   COUNT nBuffers;
 
   /* Get the argument */
-  if (GetNumArg(pLine, &nBuffers) == (BYTE *) 0)
-return;
-
-  /* Got the value, assign either default or new value*/
-  Config.cfgBuffers =
-  (nBuffers < 0 ? nBuffers : max(Config.cfgBuffers, nBuffers));
+  if (GetNumArg(pLine, &nBuffers))
+Config.cfgBuffers = nBuffers;
 }
 
 /**
@@ -1763,77 +1759,75 @@ STATIC COUNT strcasecmp(REG BYTE * d, RE
 that saves some relocation problems
 */
 
-VOID config_init_buffers(COUNT anzBuffers)
+VOID config_init_buffers(int wantedbuffers)
 {
-  REG WORD i;
   struct buffer FAR *pbuffer;
-  unsigned wantedbuffers = anzBuffers;
+  unsigned buffers = 0;
 
-  if (anzBuffers < 0)
-  {
-wantedbuffers = anzBuffers = -anzBuffers;
-  }
+  /* fill HMA with buffers if BUFFERS count >=0 and DOS in HMA */
+  if (wantedbuffers < 0)
+  wantedbuffers = -wantedbuffers;
   else if (HMAState == HMA_DONE)
-  {
-anzBuffers = (0xfff0 - HMAFree) / sizeof(struct buffer);
-  }
+buffers = (0xFFF0 - HMAFree) / sizeof (struct buffer);
 
-  anzBuffers = max(anzBuffers, 6);
-  if (anzBuffers > 99)
+  if (wantedbuffers < 6)   /* min 6 buffers*/
+  wantedbuffers = 6;
+  if (wantedbuffers > 99)  /* max 99 buffers   */
   {
-printf("BUFFERS=%u not supported, reducing to 99\n", anzBuffers);
-anzBuffers = 99;
+printf("BUFFERS=%u not supported, reducing to 99\n", wantedbuffers);
+wantedbuffers = 99;
   }
-  LoL->nbuffers = anzBuffers;
-  
-  lpTop = lpOldTop;
 
+  if (buffers < wantedbuffers) /* not less than requested  */
+  buffers = wantedbuffers;
+  LoL->nbuffers = buffers;
+
+  lpTop = lpOldTop;
   LoL->inforecptr = &LoL->firstbuf;
-  
-  {
-size_t bytes = sizeof(struct buffer) * anzBuffers;
-pbuffer = HMAalloc(bytes);
 
-if (pbuffer == NULL)
+  {
+size_t bytes = sizeof (struct buffer) * buffers;
+if ((pbuffer = HMAalloc(bytes)) == NULL)
 {
   pbuffer = KernelAlloc(bytes, 'B', 0);
+  if (HMAState == HMA_DONE)
+firstAvailableBuf = MK_FP (/*HMASEG*/0x, HMAFree);
 }
 else
 {
   LoL->bufloc = LOC_HMA;
   LoL->deblock_buf = KernelAlloc(SEC_SIZE, 'B', 0);
+
+  /* space in HMA beyond requested buffers available as user space */
+  firstAvailableBuf = pbuffer + wantedbuffers;
 }
   }
-
   LoL->firstbuf = pbuffer;
 
-  DebugPrintf(("init_buffers (size %u) at", sizeof(struct buffer)));
-  DebugPrintf((" (%p)", LoL->firstbuf));
+  DebugPrintf(("init_buffers (size %u) at (%p)",
+   sizeof(struct buffer), pbuffer));
 
-  pbuffer->b_prev = FP_OFF(pbuffer + (anzBuffers-1));
-  for (i = 1; i < anzBuffers; ++i)
+  buffers--;
+  pbuffer->b_prev = FP_OFF(pbuffer + buffers);
   {
-if (i == wantedbuffers)
+int i = buffers;
+do
 {
-  firstAvailableBuf = pbuffer;
-}  
-pbuffer->b_next = FP_OFF(pbuffer + 1);
-pbuffer++;
-pbuffer->b_prev = FP_OFF(pbuffer - 1);
-  }
-  pbuffer->b_next = FP_OFF(pbuffer - (anzBuffers-1));
-
-/* now, we can have quite some buffers in HMA
-   -- up to 50 for KE38616.
-   so we fill the HMA with buffers
-   but not if the BUFFERS count is negative ;-)
- */
+  pbuffer->b_next = FP_OFF(pbuffer + 1);
+  pbuffer++;
+  pbuffer->b_prev = FP_OFF(pbuffer - 1);
+} while (--i);
+  }
+  pbuffer->b_next = FP_OFF(pbuffer - buffers);
 
   DebugPrintf((" done\n"));
 
-  if (FP_SEG(pbuffer) == 0x)
+  if (FP_SEG(pbuffer) == /*HMASEG*/0x)
+  {
+buffers++;
 printf("Kernel: allocated %d Diskbuffers = %u Bytes in HMA\n",
-   anzBuffers, anzBuffers * sizeof(struct buffer));
+   buffers, buffers * sizeof(struct buffer));
+  }
 }
 
 /*




---
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
___
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel
--- End Message ---


[Freedos-kernel] patch: config.c

2004-03-24 Thread Arkady V.Belousov


config.pat
Description: Binary data