Yann MAGNIN
f90c07132a
@add <> builtin/loader : add "ld" builtin command <> loader/entry : add gintrace support to potentially trace an operating system <> loader/entry : add "image" dump generation in the SMEM @update <> builtin/hw : isolate hardware interaction <> fs/smemfs/pread : change long function name formalism <> loader/elf/entry : isolate hardware interaction <> terminal/read : if not cursor time is available, force-display the cursor <> terminal/util : change complex C semantic abuse @fix: <> loader/elf/image : check the available RAM size before load the image <> loader/elf/image : use non-cacheable area address to load the image <> loader/elf/image : use cacheable area address for the "entry" address generation <> loader/elf/entry : display appropriate error string if needed <> terminal/open : reduce buffer size <> terminal/open : enable cursor blink only if the device is not an emulator <> terminal/read : add "mutex" for the display <> terminal/read : sign comparison
80 lines
1.5 KiB
C
80 lines
1.5 KiB
C
#ifndef __VXBOOT_TERMINAL_H__
|
|
# define __VXBOOT_TERMINAL_H__
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
#include <gint/defs/types.h>
|
|
|
|
/* internal terminal hardcoded information */
|
|
#define TERM_PRIVATE_WATERMARK (0xdeadbeef)
|
|
#define TERM_BUFFER_NB_FRAME (2)
|
|
|
|
/* hardcoded font size (TODO: dynamic !) */
|
|
#ifdef FXCG50
|
|
#define FWIDTH 8
|
|
#define FHEIGHT 9
|
|
#endif
|
|
#ifdef FX9860G
|
|
#define FWIDTH 3
|
|
#define FHEIGHT 5
|
|
#endif
|
|
|
|
/* define terminal structure */
|
|
struct terminal {
|
|
/* windows information */
|
|
struct {
|
|
unsigned short ws_col;
|
|
unsigned short ws_row;
|
|
unsigned short ws_xpixel;
|
|
unsigned short ws_ypixel;
|
|
unsigned short ft_xpixel;
|
|
unsigned short ft_ypixel;
|
|
} winsize;
|
|
|
|
/* cursor information */
|
|
struct {
|
|
unsigned short x;
|
|
unsigned short y;
|
|
} cursor;
|
|
|
|
/* buffer information */
|
|
struct {
|
|
uint8_t *data;
|
|
off_t cursor;
|
|
size_t size;
|
|
} buffer;
|
|
|
|
/* private information */
|
|
struct {
|
|
struct {
|
|
int id;
|
|
} timer;
|
|
uint32_t watermark;
|
|
struct {
|
|
int fg;
|
|
int bg;
|
|
} color;
|
|
} private;
|
|
};
|
|
|
|
/* define the terminal */
|
|
extern struct terminal terminal;
|
|
|
|
//---
|
|
// User interface
|
|
//---
|
|
extern int terminal_open(void);
|
|
extern int terminal_write(const char *format, ...);
|
|
extern int terminal_read(void *buffer, size_t nb);
|
|
extern int terminal_close(void);
|
|
|
|
//---
|
|
// Internal interface
|
|
//---
|
|
extern void terminal_clear(void);
|
|
extern int terminal_cursor_handler(void);
|
|
extern void terminal_buffer_display(void);
|
|
extern void terminal_buffer_insert(char *buffer, size_t nb);
|
|
|
|
#endif /*__FXBOOT_TERMINAL_H__*/
|