source: rtems/c/src/lib/libbsp/i386/pc386/startup/exit.c @ cc8a388a

4.104.114.84.95
Last change on this file since cc8a388a was 5d18fb0, checked in by Joel Sherrill <joel.sherrill@…>, on 06/27/98 at 18:51:49

PC386 BSP enhancements from Aleksey Romanov (Quality Quorum
<qqi@…>). Unfortunately after merging these,
the pc386 will not boot using grub for for. It still does not
work using netboot for me. Here is his summary of changes:

rtems/c/src/lib/libbsp/i386/pc386/Makefile.in

Added support for new sub-directory

rtems/c/src/lib/libbsp/i386/pc386/bsp_specs

Made possible to build COFF image

rtems/c/src/lib/libbsp/i386/pc386/console/console.c

Added support for serial consoles, selectable by patching
binary image, added assert(), use _IBMPC_inch_sleep()
instaed of _IMBPC_inch()

rtems/c/src/lib/libbsp/i386/pc386/console/inch.c

Added _IMBPC_inch_sleep()

rtems/c/src/lib/libbsp/i386/pc386/console/outch.c

Oops - just formatting

rtems/c/src/lib/libbsp/i386/pc386/include/Makefile.in

Added support for new files

rtems/c/src/lib/libbsp/i386/pc386/include/bsp.h

Added support for new features

rtems/c/src/lib/libbsp/i386/pc386/include/pc386uart.h

New file: definitions for serial ports

rtems/c/src/lib/libbsp/i386/pc386/include/pcibios.h

New file: definitions for PCI BIOS

rtems/c/src/lib/libbsp/i386/pc386/pc386dev/Makefile.in

New file: makefile in new directory

rtems/c/src/lib/libbsp/i386/pc386/pc386dev/i386-stub-glue.c

New file: i386-stub interface

rtems/c/src/lib/libbsp/i386/pc386/pc386dev/i386-stub.c

New file: i386-stub itself

rtems/c/src/lib/libbsp/i386/pc386/pc386dev/pc386uart.c

New file: serial ports

rtems/c/src/lib/libbsp/i386/pc386/pc386dev/pcibios.c

New file: PCI BIOS support

rtems/c/src/lib/libbsp/i386/pc386/start/start.s

Commented out DEBUG_EARLY stuff, everything is working fine

rtems/c/src/lib/libbsp/i386/pc386/start/start16.s

Cleaned up

rtems/c/src/lib/libbsp/i386/pc386/startup/bspstart.c

Added call to console_resereve_resources

rtems/c/src/lib/libbsp/i386/pc386/startup/exit.c

Added support for serial console

rtems/c/src/lib/libbsp/i386/pc386/startup/ldsegs.s

Fixed typo in comments

rtems/c/src/lib/libbsp/i386/pc386/tools/Makefile.in

Changed to reflect cnages in code

rtems/c/src/lib/libbsp/i386/pc386/tools/bin2boot.c

Trivialized, problem - I do not know how to make patch
remove obsolete files - there are a lot of them there

rtems/c/src/lib/libbsp/i386/pc386/tools/binpatch.c

New file: utility to do binary patches

rtems/c/src/lib/libbsp/i386/pc386/wrapup/Makefile.in

Added support for new directory

rtems/make/custom/pc386.cfg

Add COFF image building

  • Property mode set to 100644
File size: 3.2 KB
Line 
1/*-------------------------------------------------------------------------+
2| exit.c v1.1 - PC386 BSP - 1997/08/07
3+--------------------------------------------------------------------------+
4| Routines to shutdown and reboot the PC.
5+--------------------------------------------------------------------------+
6| (C) Copyright 1997 -
7| - NavIST Group - Real-Time Distributed Systems and Industrial Automation
8|
9| http://pandora.ist.utl.pt
10|
11| Instituto Superior Tecnico * Lisboa * PORTUGAL
12+--------------------------------------------------------------------------+
13| Disclaimer:
14|
15| This file is provided "AS IS" without warranty of any kind, either
16| expressed or implied.
17+--------------------------------------------------------------------------+
18| This code is based on:
19|   exit.c,v 1.2 1995/12/19 20:07:36 joel Exp -  go32 BSP
20| With the following copyright notice:
21| **************************************************************************
22| *  COPYRIGHT (c) 1989-1998.
23| *  On-Line Applications Research Corporation (OAR).
24| *  Copyright assigned to U.S. Government, 1994.
25| *
26| *  The license and distribution terms for this file may be
27| *  found in found in the file LICENSE in this distribution or at
28| *  http://www.OARcorp.com/rtems/license.html.
29| **************************************************************************
30|
31|  $Id$
32+--------------------------------------------------------------------------*/
33
34
35#include <stdio.h>
36#include <bsp.h>
37#include <pc386uart.h>
38
39/*-------------------------------------------------------------------------+
40 | Which console is in use: either (-1) which means normal console or
41 | uart id if uart was used
42 +-------------------------------------------------------------------------*/
43extern int PC386ConsolePort;
44
45/*-------------------------------------------------------------------------+
46| External Prototypes
47+--------------------------------------------------------------------------*/
48extern rtems_boolean _IBMPC_scankey(char *);  /* defined in 'inch.c' */
49
50/*-------------------------------------------------------------------------+
51|         Function: _exit
52|      Description: Shutdown the PC. Called from libc's 'exit'.
53| Global Variables: None.
54|        Arguments: status - exit status (ignored).
55|          Returns: Nothing.
56+--------------------------------------------------------------------------*/
57void _exit(int status)
58{
59  unsigned char ch, *cp;
60  static   char line[]="EXECUTIVE SHUTDOWN! Any key to reboot...";
61
62  if(PC386ConsolePort == PC386_CONSOLE_PORT_CONSOLE)
63    {
64
65      printk("\n");
66      printk(line);
67      while(!_IBMPC_scankey(&ch))
68        ;
69      printk("\n\n");
70    }
71  else
72    {
73      PC386_uart_intr_ctrl(PC386ConsolePort, PC386_UART_INTR_CTRL_DISABLE);
74     
75      PC386_uart_polled_write(PC386ConsolePort, '\r');
76      PC386_uart_polled_write(PC386ConsolePort, '\n');
77     
78      for(cp=line; *cp != 0; cp++)
79        {
80          PC386_uart_polled_write(PC386ConsolePort, *cp);
81        }
82
83      PC386_uart_polled_read(PC386ConsolePort);
84
85      PC386_uart_polled_write(PC386ConsolePort, '\r');
86      PC386_uart_polled_write(PC386ConsolePort, '\n');
87      PC386_uart_polled_write(PC386ConsolePort, '\r');
88      PC386_uart_polled_write(PC386ConsolePort, '\n');
89    }
90
91  rtemsReboot();
92} /* _exit */
93
94
95
96
97
98
99
Note: See TracBrowser for help on using the repository browser.