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 1) and /drivers/x86_videomem.h (Article 3)


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

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