SimpleOS

LXR

Navigation



Site hébergé par : enix

The LXR Cross Referencer for SOS

source navigation ]
diff markup ]
identifier search ]
general search ]
 
 
Article:1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 6.5 ] [ 7 ] [ 7.5 ] [ 8 ] [ 9 ] [ 9.5 ]

Diff markup

Differences between /drivers/x86_videomem.h (Article 6.5) and /drivers/x86_videomem.h (Article 9)


001 /* Copyright (C) 2004  David Decotigny            001 /* Copyright (C) 2004  David Decotigny
002                                                   002 
003    This program is free software; you can redi    003    This program is free software; you can redistribute it and/or
004    modify it under the terms of the GNU Genera    004    modify it under the terms of the GNU General Public License
005    as published by the Free Software Foundatio    005    as published by the Free Software Foundation; either version 2
006    of the License, or (at your option) any lat    006    of the License, or (at your option) any later version.
007                                                   007    
008    This program is distributed in the hope tha    008    This program is distributed in the hope that it will be useful,
009    but WITHOUT ANY WARRANTY; without even the     009    but WITHOUT ANY WARRANTY; without even the implied warranty of
010    MERCHANTABILITY or FITNESS FOR A PARTICULAR    010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
011    GNU General Public License for more details    011    GNU General Public License for more details.
012                                                   012    
013    You should have received a copy of the GNU     013    You should have received a copy of the GNU General Public License
014    along with this program; if not, write to t    014    along with this program; if not, write to the Free Software
015    Foundation, Inc., 59 Temple Place - Suite 3    015    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
016    USA.                                           016    USA. 
017 */                                                017 */
018 #ifndef _SOS_X86_VIDEOMEM_H_                      018 #ifndef _SOS_X86_VIDEOMEM_H_
019 #define _SOS_X86_VIDEOMEM_H_                      019 #define _SOS_X86_VIDEOMEM_H_
020                                                   020 
021 /**                                               021 /**
022  * @file x86_videomem.h                           022  * @file x86_videomem.h
023  *                                                023  *
024  * On x86 PC platforms, the text mode screen m    024  * On x86 PC platforms, the text mode screen memory (and CGA/EGA/VGA
025  * too) is mapped into physical memory. This f    025  * too) is mapped into physical memory. This file handles access to
026  * this screen, supposed to be set in text-mod    026  * this screen, supposed to be set in text-mode, through this memory
027  * area. All the functions below print the cha    027  * area. All the functions below print the characters directly to the
028  * memory, without interpreting the escaped ch    028  * memory, without interpreting the escaped characters (such as \n,
029  * \r...)                                         029  * \r...)
030  */                                               030  */
031                                                   031 
032 #include <sos/errno.h>                            032 #include <sos/errno.h>
033                                                   033 
034 /**                                               034 /**
035  * x86 video attributes                           035  * x86 video attributes
036  * See http://webster.cs.ucr.edu/AoA/DOS/ch23/    036  * See http://webster.cs.ucr.edu/AoA/DOS/ch23/CH23-1.html
037  */                                               037  */
038 /* Normal and Dark/Light foreground */            038 /* Normal and Dark/Light foreground */
039 #define SOS_X86_VIDEO_FG_BLACK     0              039 #define SOS_X86_VIDEO_FG_BLACK     0
040 #define SOS_X86_VIDEO_FG_DKGRAY    8              040 #define SOS_X86_VIDEO_FG_DKGRAY    8
041 #define SOS_X86_VIDEO_FG_BLUE      1              041 #define SOS_X86_VIDEO_FG_BLUE      1
042 #define SOS_X86_VIDEO_FG_LTBLUE    9              042 #define SOS_X86_VIDEO_FG_LTBLUE    9
043 #define SOS_X86_VIDEO_FG_GREEN     2              043 #define SOS_X86_VIDEO_FG_GREEN     2
044 #define SOS_X86_VIDEO_FG_LTGREEN   10             044 #define SOS_X86_VIDEO_FG_LTGREEN   10
045 #define SOS_X86_VIDEO_FG_CYAN      3              045 #define SOS_X86_VIDEO_FG_CYAN      3
046 #define SOS_X86_VIDEO_FG_LTCYAN    11             046 #define SOS_X86_VIDEO_FG_LTCYAN    11
047 #define SOS_X86_VIDEO_FG_RED       4              047 #define SOS_X86_VIDEO_FG_RED       4
048 #define SOS_X86_VIDEO_FG_LTRED     12             048 #define SOS_X86_VIDEO_FG_LTRED     12
049 #define SOS_X86_VIDEO_FG_MAGENTA   5              049 #define SOS_X86_VIDEO_FG_MAGENTA   5
050 #define SOS_X86_VIDEO_FG_LTMAGENTA 13             050 #define SOS_X86_VIDEO_FG_LTMAGENTA 13
051 #define SOS_X86_VIDEO_FG_BROWN     6              051 #define SOS_X86_VIDEO_FG_BROWN     6
052 #define SOS_X86_VIDEO_FG_YELLOW    14             052 #define SOS_X86_VIDEO_FG_YELLOW    14
053 #define SOS_X86_VIDEO_FG_LTGRAY    7              053 #define SOS_X86_VIDEO_FG_LTGRAY    7
054 #define SOS_X86_VIDEO_FG_WHITE     15             054 #define SOS_X86_VIDEO_FG_WHITE     15
055 /* Background */                                  055 /* Background */
056 #define SOS_X86_VIDEO_BG_BLACK     (0 << 4)       056 #define SOS_X86_VIDEO_BG_BLACK     (0 << 4)
057 #define SOS_X86_VIDEO_BG_BLUE      (1 << 4)       057 #define SOS_X86_VIDEO_BG_BLUE      (1 << 4)
058 #define SOS_X86_VIDEO_BG_GREEN     (2 << 4)       058 #define SOS_X86_VIDEO_BG_GREEN     (2 << 4)
059 #define SOS_X86_VIDEO_BG_CYAN      (3 << 4)       059 #define SOS_X86_VIDEO_BG_CYAN      (3 << 4)
060 #define SOS_X86_VIDEO_BG_RED       (4 << 4)       060 #define SOS_X86_VIDEO_BG_RED       (4 << 4)
061 #define SOS_X86_VIDEO_BG_MAGENTA   (5 << 4)       061 #define SOS_X86_VIDEO_BG_MAGENTA   (5 << 4)
062 #define SOS_X86_VIDEO_BG_BROWN     (6 << 4)       062 #define SOS_X86_VIDEO_BG_BROWN     (6 << 4)
063 #define SOS_X86_VIDEO_BG_LTGRAY    (7 << 4)       063 #define SOS_X86_VIDEO_BG_LTGRAY    (7 << 4)
064 /* Blinking */                                    064 /* Blinking */
065 #define SOS_X86_VIDEO_FG_BLINKING  (1 << 7)       065 #define SOS_X86_VIDEO_FG_BLINKING  (1 << 7)
066                                                   066 
067                                                   067 
068 /** Setup the video RAM mapping and clear the     068 /** Setup the video RAM mapping and clear the screen */
069 sos_ret_t sos_x86_videomem_setup(void);           069 sos_ret_t sos_x86_videomem_setup(void);
070                                                   070 
071 /** Clears the screen and set the background c    071 /** Clears the screen and set the background color as given by
072     attribute */                                  072     attribute */
073 sos_ret_t sos_x86_videomem_cls(unsigned char a    073 sos_ret_t sos_x86_videomem_cls(unsigned char attribute);
074                                                   074 
075 /** Print the string on the scren with the giv    075 /** Print the string on the scren with the given attribute. Does not
076     handle scrolling */                           076     handle scrolling */
077 sos_ret_t sos_x86_videomem_putstring(unsigned     077 sos_ret_t sos_x86_videomem_putstring(unsigned char row, unsigned char col,
078                                      unsigned     078                                      unsigned char attribute,
079                                      const cha    079                                      const char *str);
080                                                   080 
081 /** Print the character on the scren with the     081 /** Print the character on the scren with the given attribute. Does not
082     handle scrolling */                           082     handle scrolling */
083 sos_ret_t sos_x86_videomem_putchar(unsigned ch    083 sos_ret_t sos_x86_videomem_putchar(unsigned char row, unsigned char col,
084                                    unsigned ch    084                                    unsigned char attribute,
085                                    unsigned ch    085                                    unsigned char c);
086                                                   086 
087 /**                                               087 /**
088  * Print the formatted string. Very restricted    088  * Print the formatted string. Very restricted version of printf(3):
089  * 1/ can print max 255 chars, 2/ supports onl    089  * 1/ can print max 255 chars, 2/ supports only %d/%i, %c, %s, %x
090  * without any support for flag charachters (e    090  * without any support for flag charachters (eg %08x).
091  */                                               091  */
092 sos_ret_t sos_x86_videomem_printf(unsigned cha    092 sos_ret_t sos_x86_videomem_printf(unsigned char row, unsigned char col,
093                                   unsigned cha    093                                   unsigned char attribute,
094                                   const char *    094                                   const char *format, /* args */...)
095      __attribute__ ((format (printf, 4, 5)));     095      __attribute__ ((format (printf, 4, 5)));
096                                                   096 
                                                   >> 097 
                                                   >> 098 /**
                                                   >> 099  * Print a character on the console (support scrolling)
                                                   >> 100  */
                                                   >> 101 sos_ret_t sos_screen_putchar (char c);
                                                   >> 102 
                                                   >> 103 /**
                                                   >> 104  * Initialize the console that supports scrolling
                                                   >> 105  */
                                                   >> 106 sos_ret_t sos_screen_init (void);
                                                   >> 107 
097 #endif /* _SOS_X86_VIDEOMEM_H_ */                 108 #endif /* _SOS_X86_VIDEOMEM_H_ */
                                                      

source navigation ] diff markup ] identifier search ] general search ]