Thread View: comp.os.msdos.programmer
4 messages
4 total messages
Started by christos
Fri, 22 Jan 1993 05:19
Causing the compter to stop from the config.sys file
Author: christos
Date: Fri, 22 Jan 1993 05:19
Date: Fri, 22 Jan 1993 05:19
7 lines
675 bytes
675 bytes
Hello there, I was wondering if it is possible to cause a pause inside the config.sys file in a similar way we can do this in the autoexec.bat file. I would appreciate any relevant resposne.... Feel free to send mail to Internet Addrees:rsl11@kuhub.cc.ukans.edu
Re: Causing the compter to stop from the config.sys file
Author: Dave
Date: Sat, 23 Jan 1993 17:33
Date: Sat, 23 Jan 1993 17:33
25 lines
1219 bytes
1219 bytes
In article <1993Jan21.231925.46627@kuhub.cc.ukans.edu> christos@kuhub.cc.ukans.edu writes: >Hello there, > > I was wondering if it is possible to cause a pause inside the >config.sys file in a similar way we can do this in the autoexec.bat file. >I would appreciate any relevant resposne.... Yes. Get DR DOS and you will be all set. The actual line you would add could be as follows: ?REM When DR DOS hit this line it will wait for you enter Y or N and then it will continue. Not quite as nice as a straight pause statement but the end result is the same. >Feel free to send mail to >Internet Addrees:rsl11@kuhub.cc.ukans.edu - Dave -- Dave Draper dave@borland.com 70031.2674@compuserve.com
Re: Causing the compter to stop from the config.sys file
Author: Duncan Murdoch
Date: Sat, 23 Jan 1993 23:48
Date: Sat, 23 Jan 1993 23:48
172 lines
5216 bytes
5216 bytes
In article <1993Jan23.173306.1751@borland.com> dave@borland.com (Dave) writes:
>In article <1993Jan21.231925.46627@kuhub.cc.ukans.edu>
>christos@kuhub.cc.ukans.edu writes:
>> I was wondering if it is possible to cause a pause inside the
>>config.sys file in a similar way we can do this in the autoexec.bat file.
>>I would appreciate any relevant resposne....
>Yes. Get DR DOS and you will be all set. The actual line you
>would add could be as follows:
>?REM
It hardly seems worth getting DR DOS for such a tiny little utility. It
took about an hour to write one in Turbo Pascal; the source code is below.
I'll be uploading this to garbo.uwasa.fi; look for an announcement on comp.
archives.msdos.announce (I expect it'll be called pausedev.zip, and should
end up in /pc/turbopas, since it's more of a demonstration of how to write
a device driver than a useful utility.)
Compile it to PAUSEDEV.EXE, then put
DEVICE=d:\path\PAUSEDEV.EXE
into your CONFIG.SYS wherever you want a pause.
Duncan Murdoch
dmurdoch@mast.queensu.ca
--------- PAUSEDEV.PAS -----------
{$S-,F-} { Stack checking wouldn't work here, and we assume near calls
}
{$X+} { Extended syntax }
{$M $1000,0,0} { We won't use the heap or stack. }
program pausedev;
{ This program implements a PAUSE command either as DEVICE=PAUSEDEV.EXE
or executed from the command line. }
uses opint, { OPro interrupt services, needed for stack switching }
crt; { Standard I/O unit that doesn't rely on DOS }
procedure strategy_routine(bp:word); interrupt; forward;
procedure interrupt_routine(bp:word); interrupt; forward;
procedure call_Main_Block; forward;
{ This procedure must come first!!! }
procedure header;
assembler;
asm
dd $FFFFFFFF { next driver }
dw $8000 { attributes of simple character device }
dw offset strategy_routine
dw offset interrupt_routine
db 'PAUSE '
end;
const
stDone = $100;
stBusy = $200;
cmInit = 0;
device_driver : boolean = false;
type
request_header = record
request_length : byte;
subunit: byte;
command_code : byte;
status : word;
reserved: array[1..8] of byte;
num_units : byte;
first_free : pointer;
args : ^char;
drive_num : byte;
end;
var
local_stack : array[1..4000] of byte;
end_of_stack : byte;
request : ^request_header;
procedure handler(var regs : intregisters);
{ This routine is called by the strategy routine, and handles all requests.
The data segment is okay, and we're running on the local_stack so we've got
plenty of space. Remember: the init sections haven't been called yet!
}
begin
with request^ do
begin
case command_code of
cmInit: begin
device_driver := true;
Call_Main_Block;
first_free := ptr(cseg,0); { Release everything!! }
status := stDone;
end;
else
status := stBusy;
end;
end;
end;
procedure RetFar; assembler;
{ Replacement for the IRET code that ends the interrupt routines below }
asm
mov sp,bp
pop bp
pop es
pop ds
pop di
pop si
pop dx
pop cx
pop bx
pop ax
retf
end;
procedure strategy_routine(bp:word);
var
regs : intregisters absolute bp;
begin
with regs do
request := ptr(es,bx);
RetFar;
end;
procedure interrupt_routine(bp:word);
var
regs : intregisters absolute bp;
begin
SwapStackandCallNear(Ofs(handler),@end_of_stack,regs);
RetFar;
end;
procedure do_pause;
begin
while keypressed do readkey;
writeln('Press any key to continue....');
repeat until keypressed;
end;
procedure Ret_From_Main_Block; assembler; { Must have declaration just
like Call_Main_Block }
asm
end;
procedure Call_Main_Block; assembler; { Must come just before main
entry point }
asm
db $eb, 6 { Jump over the Ret instruction
and System init }
end;
begin
do_pause;
if Device_Driver then
asm
pop bp
jmp Ret_From_Main_Block;
end
else
halt;
header; { This line is never reached, but it fools the linker
so that everything is loaded properly. }
end.
Re: Causing the compter to stop from the config.sys file
Author: Timo Salmi
Date: Sun, 24 Jan 1993 07:04
Date: Sun, 24 Jan 1993 07:04
21 lines
1624 bytes
1624 bytes
In article <dmurdoch.337.727832892@mast.queensu.ca> dmurdoch@mast.queensu.ca (Duncan Murdoch) writes: >In article <1993Jan23.173306.1751@borland.com> dave@borland.com (Dave) writes: >>Yes. Get DR DOS and you will be all set. The actual line you >>would add could be as follows: > >It hardly seems worth getting DR DOS for such a tiny little utility. It >took about an hour to write one in Turbo Pascal; the source code is below. Ah, but the point of the DR-DOSsers' and 4DOSsers' never is solving the majority's command.com-MsDos related problems, but to make converts. I always wonder why not go all the way and suggest buying a mainframe and using Unix :-). (Both 4DOS and DR-DOS are fine products, of course). Followups redirected to alt.religion.computers. .................................................................. Prof. Timo Salmi Co-moderator of comp.archives.msdos.announce Moderating at garbo.uwasa.fi anonymous FTP archives 128.214.87.1 Faculty of Accounting & Industrial Management; University of Vaasa Internet: ts@uwasa.fi Bitnet: salmi@finfun ; SF-65101, Finland
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads