diff packages/hal/i386/pcmb/current/include/pcmb.inc @ 208:e0c0827131d1 ecos

Merge from eCos master repository on 2002-05-20-20:11:54-BST
author jlarmour
date Mon, 20 May 2002 22:19:26 +0000
parents ac086aa3217e
children d2c90368aeef
line wrap: on
line diff
--- a/packages/hal/i386/pcmb/current/include/pcmb.inc
+++ b/packages/hal/i386/pcmb/current/include/pcmb.inc
@@ -7,29 +7,38 @@
 ##      PC platform support
 ##
 ##=============================================================================
-#####COPYRIGHTBEGIN####
-#                                                                          
-# -------------------------------------------                              
-# The contents of this file are subject to the Red Hat eCos Public License 
-# Version 1.1 (the "License"); you may not use this file except in         
-# compliance with the License.  You may obtain a copy of the License at    
-# http://www.redhat.com/                                                   
-#                                                                          
-# Software distributed under the License is distributed on an "AS IS"      
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the 
-# License for the specific language governing rights and limitations under 
-# the License.                                                             
-#                                                                          
-# The Original Code is eCos - Embedded Configurable Operating System,      
-# released September 30, 1998.                                             
-#                                                                          
-# The Initial Developer of the Original Code is Red Hat.                   
-# Portions created by Red Hat are                                          
-# Copyright (C) 1998, 1999, 2000 Red Hat, Inc.                             
-# All Rights Reserved.                                                     
-# -------------------------------------------                              
-#                                                                          
-#####COPYRIGHTEND####
+#####ECOSGPLCOPYRIGHTBEGIN####
+# -------------------------------------------
+# This file is part of eCos, the Embedded Configurable Operating System.
+# Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+#
+# eCos 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.
+#
+# eCos 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 eCos; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+#
+# As a special exception, if other files instantiate templates or use macros
+# or inline functions from this file, or you compile this file and link it
+# with other works to produce a work based on this file, this file does not
+# by itself cause the resulting work to be covered by the GNU General Public
+# License. However the source code for this file must still be made available
+# in accordance with section (3) of the GNU General Public License.
+#
+# This exception does not invalidate any other reasons why a work based on
+# this file might be covered by the GNU General Public License.
+#
+# Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
+# at http://sources.redhat.com/ecos/ecos-license
+# -------------------------------------------
+#####ECOSGPLCOPYRIGHTEND####
 ##=============================================================================
 #######DESCRIPTIONBEGIN####
 ##
@@ -219,6 +228,66 @@ 2:	es
 
 	/* Now we're all loaded up in memory. */
 
+	/* Optionally switch to a high-res video before entering	*/
+	/* protected mode. The mode is controlled by an option in	*/
+	/* the RedBoot configuration, which is not readily visible	*/
+	/* in the application configuration. Therefore RedBoot also	*/
+	/* performs some information-related BIOS calls, getting the	*/
+	/* main SVGA BIOS information and the mode-specific		*/
+	/* information. These are placed in video memory, because	*/
+	/* nothing else should be touching that and it avoids having	*/
+	/* some other special buffer shared between RedBoot and the	*/
+	/* application. The disadvantage is possibly some strange junk	*/
+	/* visible on the screen after RedBoot has started.		*/
+#ifdef CYGNUM_HAL_I386_PC_STARTUP_VIDEO_MODE
+	movw	$0x4f02, %ax
+	movw	$ CYGNUM_HAL_I386_PC_STARTUP_VIDEO_MODE, %bx
+	int	$0x10
+
+	/* SVGA information @ 0x000A0000 */
+	/* Placing VBE2 at this location before the int10 gives more information */
+	movw	$0xA000, %ax
+	movw	%ax, %es
+	movw	$0x0, %di
+	movb	$('V'), %es:0(%di)
+	movb	$('B'), %es:1(%di)
+	movb	$('E'), %es:2(%di)
+	movb	$('2'), %es:3(%di)
+	movw	$0x4f00, %ax
+	int 	$0x10
+
+	/* Information about all supported modes starting @ 0x000A0400	*/
+	/* ds:si is used to index the main mode table, offset 14	*/
+	movw	%es:14(%di),%si
+	movw	%es:16(%di),%ax
+	movw	%ax,%ds
+
+	/* es:di is used for the destination.				*/
+	movw	$0xA000,%ax
+	movw	%ax,%es
+	movw	$0x0400,%di
+
+modes_loop:
+	/* The mode table is terminated by a -1 entry			*/
+	movw	%ds:0(%si), %cx
+	cmpw	$0xffff,%cx
+	je	modes_done
+	movw	$0x4f01, %ax
+	int	$0x10
+	addw	$0x0100, %di
+	addw	$2,%si
+	jmp	modes_loop
+modes_done:
+
+	/* Information about the current mode @ 0x000A0200	*/
+	movw	$0xA000, %ax
+	movw	%ax, %es
+	movw	$0x0200, %di
+	movw	$0x4f01, %ax
+	movw	$ CYGNUM_HAL_I386_PC_STARTUP_VIDEO_MODE, %cx
+	int	$0x10
+#endif
+
 	/* Disable interrupt handling. */
 	cli