Title:          pwrm
Version:        1.0
Description:    Laptop power management for Linux (for machines with
                Western Digital chipsets only).
Author:         Hansruedi Heeb - heeb@iis.ethz.ch
Maintained-by:  same
Maintained-at:  sunsite.unc.edu.
                tsx-11.mit.edu
Platforms:      Only laptops with Western Digital 7600 chipsets
                Installation check is provided if you do not know your chipset
Copying-Policy: Freely Redistributable
Keywords:       Linux, laptop, power management, WD7600, Western Digital
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            From samba!concert!gatech!destroyer!sol.ctr.columbia.edu!usc!snorkelwacker.mit.edu!bloom-picayune.mit.edu!daemon Sun Oct 18 18:24:42 EDT 1992
Article: 13504 of comp.os.linux
Newsgroups: comp.os.linux
Path: samba!concert!gatech!destroyer!sol.ctr.columbia.edu!usc!snorkelwacker.mit.edu!bloom-picayune.mit.edu!daemon
From: Peter MacDonald <pmacdona@tadpole.bcsc.gov.bc.ca>
Subject: Patch to preselect video mode + set ramdisk size
Message-ID: <1992Oct17.073112.13670@athena.mit.edu>
Sender: daemon@athena.mit.edu (Mr Background)
Reply-To: pmacdona@tadpole.bcsc.gov.bc.ca
Organization: The Internet
Date: Sat, 17 Oct 1992 07:31:12 GMT
Lines: 561

Here is my first patch in a good long time.  It does two things.

1) Using a modified version of rdev.c, we can set the startup video
mode of an image.  No more recompiling if you want to change modes.
Example:
		
	vidmode /dev/fd0 1

Here, vidmode is just a link to the new rdev.c pgm enclosed.

2) Set the ramdisk size to nonzero to boot up using a ramdisk.
Loading starts from the 512K mark.  Like so:

	ramsize /dev/fd0 620

Following are the patches, 
Let me know of any problems.

Peter
pmacdona@sanjuan.uvic.ca

-----------------------------------------------------------------
*** boot/setup.S.bak	Fri Oct 16 18:05:07 1992
--- boot/setup.S	Fri Oct 16 23:51:04 1992
***************
*** 282,292 ****
  chsvga:	cld
  	push	ds
  	push	cs
  	pop	ds
  	mov 	ax,#0xc000
  	mov	es,ax
  	lea	si,msg1
- #ifndef SVGA_MODE
  	call	prtstr
  flush:	in	al,#0x60		! Flush the keyboard buffer
  	cmp	al,#0x82
--- 282,297 ----
  chsvga:	cld
  	push	ds
  	push	cs
+ 	mov	ax,[0x01f6]
  	pop	ds
+ 	mov	[0x01f6],ax
+         cmp	ax,#NORMAL_VGA
+ 	je	defvga
+ 	cmp	ax,#0xfffe
+ 	jne	svga
  	mov 	ax,#0xc000
  	mov	es,ax
  	lea	si,msg1
  	call	prtstr
  flush:	in	al,#0x60		! Flush the keyboard buffer
  	cmp	al,#0x82
***************
*** 297,308 ****
  	je	svga			! yes - svga selection
  	cmp	al,#0xb9		! space ?
  	jne	nokey			! no - repeat
! #endif
! #if !defined(SVGA_MODE) || SVGA_MODE == NORMAL_VGA
! 	mov	ax,#0x5019
  	pop	ds
  	ret
- #endif
  svga:	cld
  	lea 	si,idati		! Check ATI 'clues'
  	mov	di,#0x31
--- 302,310 ----
  	je	svga			! yes - svga selection
  	cmp	al,#0xb9		! space ?
  	jne	nokey			! no - repeat
! defvga:	mov	ax,#0x5019
  	pop	ds
  	ret
  svga:	cld
  	lea 	si,idati		! Check ATI 'clues'
  	mov	di,#0x31
***************
*** 552,560 ****
  	call	prtstr
  	pop	si
  	add	cl,#0x80
! #if defined(SVGA_MODE) && SVGA_MODE != NORMAL_VGA
! 	mov	al,#SVGA_MODE		! Preset SVGA mode 
! #else
  nonum:	call	getkey
  	cmp	al,#0x82
  	jb	nonum
--- 554,564 ----
  	call	prtstr
  	pop	si
  	add	cl,#0x80
! 	mov	ax,[0x01f6]
! 	cmp	ax,#0xfffe
! 	je	nonum
! 	cmp	ax,#NORMAL_VGA
! 	jne	gotmode
  nonum:	call	getkey
  	cmp	al,#0x82
  	jb	nonum
***************
*** 566,573 ****
  zero:	sub	al,#0x0a
  nozero:	sub	al,#0x80
  	dec	al
! #endif
! 	xor	ah,ah
  	add	di,ax
  	inc	di
  	push	ax
--- 570,576 ----
  zero:	sub	al,#0x0a
  nozero:	sub	al,#0x80
  	dec	al
! gotmode:	xor	ah,ah
  	add	di,ax
  	inc	di
  	push	ax
*** boot/bootsect.S.bak	Thu Oct 15 22:53:53 1992
--- boot/bootsect.S	Fri Oct 16 19:09:27 1992
***************
*** 425,431 ****
  	.byte 13,10
  	.ascii "Loading"
  
! .org 506
  swap_dev:
  	.word SWAP_DEV
  root_dev:
--- 425,435 ----
  	.byte 13,10
  	.ascii "Loading"
  