[comp.os.msdos.misc] 2 part problem

bucacs@ux1.cts.eiu.edu (Carlos Dragonslayer Butler) (05/11/91)

	I have a slight problem. I need to write a routine (preferably in    
Pascal) that will reboot a machine. The second part to this problem is
that on reboot, I need to select my config.sys file. The computer in
question needs to have one configuration for PLATO use, and another for
Novell use. Cant it be done? How???
-- 
 Carlos Dragonslayer Butler|       "People often condescend          
   bucacs@ux1.ctseiu.edu   |     what they fail to comprehend.       
       Lord of House       |      Ignorance makes life easier.       
                           |  Peace, knowledge, love and happiness." 

sguerke@brahms.udel.edu (Stephen Guerke) (05/11/91)

In article <1991May10.202806.18512@ux1.cts.eiu.edu> bucacs@ux1.cts.eiu.edu (Carlos Dragonslayer Butler) writes:
>
>	I have a slight problem. I need to write a routine (preferably in    
>Pascal) that will reboot a machine. The second part to this problem is
>that on reboot, I need to select my config.sys file. The computer in
>question needs to have one configuration for PLATO use, and another for
>Novell use. Cant it be done? How???
>-- 
> Carlos Dragonslayer Butler|       "People often condescend          
>   bucacs@ux1.ctseiu.edu   |     what they fail to comprehend.       
>       Lord of House       |      Ignorance makes life easier.       
>                           |  Peace, knowledge, love and happiness." 

You can do a reboot with the following:

Using a simple ASCII text editor (VDE or QEDIT) write the following
debug script.

NOTE: line numbers are for reference DO NOT TYPE THE LINE NUMBERS (or
the following colons) IN YOUR FILE!!

1:  a 100
2:  mov ax,40
3:  mov ds,ax
4:  mov ax,1234
5:  mov [0072],ax
6:  jmp f000:e05b
7:
8:  r cx
9:  10
10: n reset.com
11: w
12: q

NOTE: Be sure that line 7: is blank.

Proof read the script very carefully.  Save it as RESET.SCR.  Now
comes the fun part.  Be sure that DEBUG (its usually found in your
/DOS subdirectory) is in your PATH.  Then at the prompt type:

c:\> debug < reset.scr

if everything works properly (and it should if you typed the script
properly :-)) you will find a little program named RESET.COM in your
directory.

RESET.COM is a little program that will perform a warm boot on your
machine and can be used in a batch file.

I use it to quickly and easily reconfigure my machine (286 w/ 2.5Mb
RAM) from running in a DOS environment with a 1.5Mb cache in extended
memory and .5Mb expanded memory left open for Quattro Pro and
WordPerfect, etc. to an evironment for running WINDOWS 3.0 (yeah, I
actually run WINDOWS on a 286...no flames please! :-))

I have created a subdirectory on my harddrive called /SYS in which I
have put config and autoexec files designed for each environment (and
a few other batch files that need to be changed for each environment)
and given them an extention that identifies them. ex. CONFIG.DOS,
CONFIG.WIN, AUTOEXEC.DOS, AUTOEXEC.WIN etc.

In my root directory I have put the following two batch files:

STARTDOS.BAT
@ECHO OFF
REM FOR STARTING DOS ENVIRONMENT
COPY C:\SYS\CONFIG.DOS C:\CONFIG.SYS
COPY C:\SYS\AUTOEXEC.DOS C:\AUTOEXEC.BAT
C:\BIN\RESET.COM 
REM    ^^^^^^^^^ THE FILE YOU JUST CREATED

and

STARTWIN.BAT
@ECHO OFF
REM FOR STARTING WINDOWS
COPY C:\SYS\CONFIG.WIN C:\CONFIG.SYS
COPY C:\SYS\AUTOEXEC.WIN C:\AUTOEXEC.BAT
C:\BIN\RESET.COM

I hope this helps
Steve

 


-- 
          --------------------------------------------------------
   Stephen Guerke, Coord. Computer Resources  sguerke@brahms.udel.edu
   University of Delaware Parallel Program    stephen.guerke@mvs.udel.edu
   Georgetown, DE 19947                       ILV20078@UDELVM.UDEL.EDU

kai@kaiki.toppoint.de (Kai Voelcker) (05/14/91)

sguerke@brahms.udel.edu (Stephen Guerke) writes:

> In article <1991May10.202806.18512@ux1.cts.eiu.edu> bucacs@ux1.cts.eiu.edu (C
> >
> >	I have a slight problem. I need to write a routine (preferably in    
> >Pascal) that will reboot a machine.

Hi,
everything Stephen Guerke wrote in his follow-up works fine. And here is a
small code for use inside pascal:
Procedure      WarmBoot;
  INLINE(
  { MOV	AX,0040h		  }    $B8/$40/$00
  { MOV	ES,AX		          }   /$8E/$C0
  { MOV	Word Ptr ES:[0072h],1234h }   /$26/$C7/$06/$72/$00/$34/$12
  { MOV	AX,0F000h                 }   /$B8/$00/$F0
  { PUSH AX                       }   /$50
  { MOV	AX,0FFF0h                 }   /$B8/$F0/$FF
  { PUSH AX                       }   /$50
  { RETF                          }   /$CB  ) ;

Procedure      ColdBoot;
  INLINE(
  { MOV	AX,0F000h                 }    $B8/$00/$F0
  { PUSH AX                       }   /$50
  { MOV	AX,0FFF0h                 }   /$B8/$F0/$FF
  { PUSH AX                       }   /$50
  { RETF                          }   /$CB  ) ;
_________________________________________________________________
| Kai Voelcker, Kappelner Str. 18, D-2300 Kiel 1, +49 431 335605 |
|           interests: masm, c, pascal;  OR Algorithms           |
| >>> polite notice: I have to pay for incoming mail. Thanks <<< |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

campbell@cutmcvax.cs.curtin.edu.au (Trevor George Campbell CC361) (05/22/91)

kai@kaiki.toppoint.de (Kai Voelcker) writes:

>sguerke@brahms.udel.edu (Stephen Guerke) writes:

>> In article <1991May10.202806.18512@ux1.cts.eiu.edu> bucacs@ux1.cts.eiu.edu (C
>> >
>> >	I have a slight problem. I need to write a routine (preferably in    
>> >Pascal) that will reboot a machine.

>Hi,
>everything Stephen Guerke wrote in his follow-up works fine. And here is a
>small code for use inside pascal:
>Procedure      WarmBoot;
>  INLINE(

>Procedure      ColdBoot;
>  INLINE(
>  { MOV	AX,0F000h                 }    $B8/$00/$F0
>  { PUSH AX                       }   /$50
>  { MOV	AX,0FFF0h                 }   /$B8/$F0/$FF
>  { PUSH AX                       }   /$50
>  { RETF                          }   /$CB  ) ;

This code seems longer than reqd. to me. I created a .com file with debug
a total of 16 bytes for a warm boot, and 5 for a cold boot. Under TP you just
need to do a jmp ffff:0000 for a cold boot. naturally this needs to be
 converted to inline but i don't have the code on me for this, will bring it
tomorrow and post if any interest....

.
--
Trevor          alias  <**<TOMCAT>**>