From 0855648f58f675435a951443ab4ecdd25dfc4824 Mon Sep 17 00:00:00 2001 From: Bart Oldeman Date: Tue, 13 Nov 2001 23:45:25 +0000 Subject: [PATCH] Added new build system files, sys documentation, "rm" batch file git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@323 6ac86273-5f31-0410-b378-82cca8765d1b --- docs/sys.txt | 177 +++++++++++++++++++++++++++++++++++++++++++++ getmake.bat | 10 +++ kernel/iprf.c | 6 ++ kernel/rtlsupt.asm | 68 +++++++++++++++++ utils/rmfiles.bat | 10 +++ 5 files changed, 271 insertions(+) create mode 100644 docs/sys.txt create mode 100644 getmake.bat create mode 100644 kernel/iprf.c create mode 100644 kernel/rtlsupt.asm create mode 100644 utils/rmfiles.bat diff --git a/docs/sys.txt b/docs/sys.txt new file mode 100644 index 0000000..1782b0b --- /dev/null +++ b/docs/sys.txt @@ -0,0 +1,177 @@ +SYS documentation by Jeremy Davis +Updated by Bart Oldeman + +SYS's standard behavior is very similar (though in +my opinion improved) to that of other DOSes. +SYS (no options) should provide a general usage, +and SYS CONFIG /help (or SYS CONFIG /?) should +provide usage for the new configuration options. + +Admittedly its brief, but it is there. +Below is a more detailed documentation on its +usage (from memory, but I believe it is close to right). +The best documentation (and maybe only) is the +source itself. + + +The simplest usage: + +SYS dest: + +dest should be the drive (A:, B:, C:, ...) you wish +to be bootable with FreeDOS (kernel & command.com) +When using this form, KERNEL.SYS and COMMAND.COM +must reside either in the current directory (which +is searched first) or in recent revisions may also +be in the root directory of the current drive. + +Complete form: + +SYS [source] dest: [bootsect [BOTH]] + +Here dest is the same as before, but this time +you specify where KERNEL.SYS and COMMAND.COM are. +Source may simply be a drive (in this case it +is similar to PC & MS SYS). The current directory +of the specified drive is first searched for +KERNEL.SYS & COMMAND.COM and if not found then +the root directory of the specified drive is tried. +Alternatively, you may specify a path (either fully +qualified or relative) to where KERNEL.SYS and +COMMAND.COM may be found; note that this should +only search this directory and will fail if they +are not found, ie it will not check for them on +the root directory of the drive specified when +a path is given. It should also fail if the +source and destination drive are both the same +and would result in trying to SYS from the root +to the root (ie trying to SYS from C:\ to C:\). + +If you specify a name for "bootsect", for instance, +bootsect.fd, SYS will write to that file instead of +the real boot sector. You will obtain a 512-byte file +containing the boot sector, which can then be used +for dual booting or diagnostic purposes. + +If you also specify BOTH, sys will write to both +the image file and the boot sector. + + +Kernel Configuration Options: + +Simplest form: + +SYS CONFIG + +This will simply display the current settings +for the file KERNEL.SYS in the current directory. +It is useful to see what the options are currently +set to, what options are supported, and should +show valid values along with defaults (defaults are +the valid values with a '*' next to them). + +Optionally specify file: + +SYS CONFIG [drive][path]KERNEL.SYS + +This form behaves as above, except will display +the settings for the kernel file you specify. +drive and path are optional, and generally just +a \ will be used to indicate root directory of +current drive. KERNEL.SYS specifies the filename +of the kernel, which may not be "KERNEL.SYS", +for example when testing you want to alter +KERNTEST.SYS and later copy (or rename) this to +KERNEL.SYS for booting. + + +Changing options: + +SYS CONFIG OPTION1=value [OPTION2=value ...] + +This form will read the current settings from +the kernel (KERNEL.SYS in the current directory) +and set the options specified to the value given. +If the value is potentially invalid (too large, too +small, etc) then a warning will be displayed, but +the change will still occur. The kernel file is +only updated if at least one option is different from the +current settings. If you wish to force the kernel +file to be written to, then set the same option +twice (OPTION1=oddvalue OPTION1=desiredvalue), with +the 1st time the value being different from the +current one and the rightmost one being the desired +value. Currently three options are supported. +Note: currently only the 1st three letters are +actually checked, so they may be abreviated to +DLA, SHO, and SKI and with my recent patch you may +specify the value as either a decimal number 0,10,255,... +or as a hexidecimal number 0x0,0xA, 0xFF... + +DLASORT which may be set to 0 or 1 +DLASORT=0 or DLASORT=1 +This option is for specifying whether Drive Letter +Assignment should follow the normal MSDOS way of +all primary partitions across drives and then +extended partitions, or the more logical +all partitions (primary & extended) on the 1st +drive, then repeat for all following drives +(all primary & extended, then try next drive). +0 corresponds to MS way and 1 corresponds to first +drive completely, then next ... + +SHOWDRIVEASSIGNMENT which may be 0 or 1 +SHOWDRIVEASSIGNMENT=0 or SHOWDRIVEASSIGNMENT=1 +If 1 then the normal drive assignment information +is displayed upon booting. If 0 then this information +is supressed (not shown). + +SKIPCONFIGSECONDS which may be -128 to 127. +A negative value ( < 0 ) indicates that F5/F8 +processing will be skipped (the kernel won't check +if you pressed these keys, so you can't skip config +file (CONFIG.SYS) processing). A 0 means you must +have pressed the key precisely for when the kernel +checks for it - essentially skipping, though a well +timed finger will still get to use it. And any value +greater than 0 I belive is the seconds the kernel will +display the prompt and wait for you to press the key +before assuming you didn't. + +FORCELBA which may be 0 or 1 +FORCELBA=0 or FORCELBA=1 +If 1 then the kernel will use LBA (extended INT13) +techniques to address all partitions if possible, +even if these have a non-LBA partition type and +are completely below cylinder 1023 (usually the 8MB +boundary). This is 0 by default, for compatibility +reasons. Setting this to 1 may bypass some buggy +BIOSes and gives slightly better performance. + +GLOBALENABLELBASUPPORT which maybe 0 or 1 +GLOBALENABLELBASUPPORT=0 or GLOBALENABLELBASUPPORT=1 +If 0 then LBA will be completely disabled, irrespective +of the FORCELBA setting. You need this if FreeDOS thinks +you have LBA available, but in reality you do not. +This setting is set to 1 by default. + +Example: To set the kernel in the current directory +to have a timeout of 5 seconds (default is 2) run +SYS CONFIG SKI=5 + + +Changing options of specified file: + +SYS CONFIG [drive][path]KERNEL.SYS OPTION1=value ...] + +This is just like previous section on setting options, +except the first argument after CONFIG specifies which +kernel file to use. The filename is the same form used +for displaying options of specified kernel file described +above. + +Example2: To set a kernel in the root directory to +not show drive assignment and change the timeout +to never check +SYS CONFIG \KERNEL.SYS SKI=-1 SHOWDRIVEASSIGNMENT=0x0 + diff --git a/getmake.bat b/getmake.bat new file mode 100644 index 0000000..25c9c0b --- /dev/null +++ b/getmake.bat @@ -0,0 +1,10 @@ +@if not \%MAKE% == \ goto make_set + +@if \%COMPILER% == \TC2 set MAKE=%TC2_BASE%\make +@if \%COMPILER% == \TURBOCPP set MAKE=%TP1_BASE%\bin\make +@if \%COMPILER% == \TC3 set MAKE=%TC3_BASE%\bin\make +@if \%COMPILER% == \BC5 set MAKE=%BC5_BASE%\bin\make +@if \%COMPILER% == \WATCOM set MAKE=%WATCOM%\binw\wmake /ms +@if \%COMPILER% == \MSCL8 set MAKE=%MS_BASE%\nmake /nologo + +:make_set diff --git a/kernel/iprf.c b/kernel/iprf.c new file mode 100644 index 0000000..873a7eb --- /dev/null +++ b/kernel/iprf.c @@ -0,0 +1,6 @@ +/* init code printf */ +/* simply include prf.c while defining */ +/* _INIT: reduces command line length */ +/* and simplifies make procedure */ +#define _INIT 1 +#include "prf.c" diff --git a/kernel/rtlsupt.asm b/kernel/rtlsupt.asm new file mode 100644 index 0000000..5f5a82e --- /dev/null +++ b/kernel/rtlsupt.asm @@ -0,0 +1,68 @@ +; File: +; rtlsupt.asm +; Description: +; Assembly support routines for long mul/div +; was forced to do that for WATCOM C, which has _near +; LMUL/LDIV routines. shouldn't harm for others +; +; Copyright (c) 2001 +; tom ehlert +; All Rights Reserved +; +; This file is part of DOS-C. +; +; DOS-C is free software; you can redistribute it and/or +; modify it under the terms of the GNU General Public License +; as published by the Free Software Foundation; either version +; 2, or (at your option) any later version. +; +; DOS-C is distributed in the hope that it will be useful, but +; WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +; the GNU General Public License for more details. +; +; You should have received a copy of the GNU General Public +; License along with DOS-C; see the file COPYING. If not, +; write to the Free Software Foundation, 675 Mass Ave, +; Cambridge, MA 02139, USA. +; +; $Id$ +; +; Rev 1.0 02 Jul 1995 9:04:50 patv +;Initial revision. +; $EndLog$ +; + + %include "segs.inc" + + +segment _TEXT + +; +; cdecl calling conventions +; +; ULONG FAR MULULUS(ULONG mul1, USHORT mul2) - MULtiply ULong by UShort +; +%IFNDEF I386 +P8086 +%ELSE +P386 ; Turn on 386 instructions. +%ENDIF ; I386 + + + global _MULULUS +_MULULUS: + + push bp + mov bp,sp + mov bx,[bp+6+4] ; short mul2 + mov ax,[bp+6+2] ; high part of mul1 + mul bx + mov cx,ax + mov ax,[bp+6+0] ; low part of mul1 + mul bx + add dx,cx ; add in high part of result + + pop bp + retf + diff --git a/utils/rmfiles.bat b/utils/rmfiles.bat new file mode 100644 index 0000000..5633e42 --- /dev/null +++ b/utils/rmfiles.bat @@ -0,0 +1,10 @@ +@echo off +:loop_commandline + +if \%1 == \ goto done_with_commandline +del %1 +shift +goto loop_commandline + +:done_with_commandline +