Operating System
Functions
utilities.h File Reference

most importantly low level function used in kernel More...

#include <stdint.h>
#include "ctype.h"

Go to the source code of this file.

Functions

void clear_screen ()
 
void hello_hybrid_programming ()
 testcase More...
 
int add (int, int)
 
int kbhit ()
 
int readkb ()
 
static void set_cursor (uint8_t row, uint8_t col)
 
static uint16_t get_cursor ()
 
static void __screen_scroll (uint16_t row_col_lu, uint16_t row_col_rd, uint8_t lines, uint16_t direction)
 
static void scroll_up_one_line ()
 

Detailed Description

most importantly low level function used in kernel

Definition in file utilities.h.

Function Documentation

◆ __screen_scroll()

static void __screen_scroll ( uint16_t  row_col_lu,
uint16_t  row_col_rd,
uint8_t  lines,
uint16_t  direction 
)
inlinestatic

no need to use. screen the scrool.

Parameters
row_col_lu16bits. high: row, low: col. left upper point.
row_col_rdhigh 16bits row, low: col. right down point.
lineshow many lines to scrool
direction0 if scroll up. any int otherwise.

Definition at line 68 of file utilities.h.

◆ add()

int add ( int  ,
int   
)

testcase

◆ clear_screen()

void clear_screen ( )

◆ get_cursor()

static uint16_t get_cursor ( )
inlinestatic

get the current cursor

Returns
a 16 bits int. the high 8 bits store the row. the low 8 bits store the column.

Definition at line 45 of file utilities.h.

◆ hello_hybrid_programming()

void hello_hybrid_programming ( )

testcase

◆ kbhit()

int kbhit ( )

unbocked function to test whether kb is hit. WARNING: this function will not remove kbhit in buffer. you need to call readkb to do so.

Returns
return zero if no kb is hit. return ascii otherwise.

◆ readkb()

int readkb ( )

◆ scroll_up_one_line()

static void scroll_up_one_line ( )
inlinestatic

Definition at line 91 of file utilities.h.

◆ set_cursor()

static void set_cursor ( uint8_t  row,
uint8_t  col 
)
inlinestatic

directly set cursor

Parameters
rowrange 0~24
colrange 0~79

Definition at line 26 of file utilities.h.