#ifndef __OS_H__ #define __OS_H__ //Replacement for Ndless typedef __builtin_va_list va_list; #define va_start(ap,p) __builtin_va_start(ap, p) #define va_arg(ap,type) __builtin_va_arg(ap, type) #define va_end(ap) __builtin_va_end(ap) /* As a non-inline function to be called from Thumb state */ void clear_cache(void); typedef enum BOOL {FALSE = 0, TRUE = 1} BOOL; typedef void FILE; struct stat { unsigned short st_dev; unsigned int st_ino; // 0 unsigned int st_mode; // see S_ macros above unsigned short st_nlink; // 1 unsigned short st_uid; // 0 unsigned short st_gid; // 0 unsigned short st_rdev; // = st_dev unsigned int st_size; unsigned int st_atime; unsigned int st_mtime; unsigned int st_ctime; }; int hwtype(void); #define is_touchpad FALSE //Functions from boot2 //! fopen from boot2 #define fopen ((void *(*)(const char *, const char *))0x11856590) //! fclose from boot2 #define fclose ((void(*)(void *))0x1185634C) //! fread from boot2 #define fread ((unsigned int(*)(void *, unsigned int, unsigned int, FILE *))0x118566CC) //! fgets from boot2 #define fgets ((char *(*)(char *, int, FILE *))0x11902DBC) //! stat from boot2 #define _stat ((int(*)(const char *, void *))0x11859F5C) int stat(const char *, void *); int feof(FILE *); //! display_msg_to_screen from boot2 #define display_msg_to_screen ((void(*)(const char *, int, int))0x11801C94) //! printf from boot2 #define print_rs232 ((void(*)(const char *))0x11800904) //! strlen from boot2 #define strlen ((unsigned int(*)(const char *))0x11856E40) //! strcpy from boot2 #define strcpy ((char *(*)(char *, const char *))0x11857A44) //! strncpy from boot2 #define strncpy ((char *(*)(char *, const char *, int))0x11856EC8) //! strcmp from boot2 #define strcmp ((int(*)(const char *, const char *))0x11856E00) //! strncmp from boot2 #define strncmp ((int(*)(const char *, const char *, int))0x11856E68) #define strtol strtoul //! strtoul from boot2 #define strtoul ((unsigned long int(*)(const char *, char **, int))0x11923094) //! memset from boot2 #define memset ((void *(*)(void *, int, unsigned int))0x11856D54) //! vsprintf from boot2 #define vsprintf ((int(*)(char *, const char *, ...))0x11855100) //! malloc from boot2 #define malloc ((void *(*)(unsigned int))0x11854E9C) //! free from boot2 #define free ((void(*)(void *))0x11854E90) //Replacement for nIO typedef int nio_console; #define NIO_MAX_COLS 0 #define NIO_MAX_ROWS 0 #define NIO_COLOR_WHITE 0 #define NIO_COLOR_BLACK 0 void nio_init(int *, int, int, int, int, int, int, int); void nio_set_default(int *); int nio_gets(char *); int uart_puts(const char *); void uart_printf(char *, ...); int nio_puts(const char*); int nio_printf(const char *, ...); void nio_free(int *); //Other int main2(int, char *[]); #define main main(void){char* argv[] = {"","/documents/linux/linux.ll2.tns"};main2(2,argv); return 0;} int main2 #endif