From edbcac06e490731c923ddd18d948fa76dc3ee9b7 Mon Sep 17 00:00:00 2001 From: Michal Idziorek Date: Tue, 2 Dec 2014 12:39:30 +0100 Subject: Adapt for ncurses --- userspace/Makefile | 1 + userspace/sys/sys.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) (limited to 'userspace') diff --git a/userspace/Makefile b/userspace/Makefile index 0c41347..0761f81 100644 --- a/userspace/Makefile +++ b/userspace/Makefile @@ -21,6 +21,7 @@ ext2.img: $(PROGS) cp $^ mnt/bin echo "++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++." > mnt/home/miguel/hello.brain # cp ~/temp/fool-os-stuff/binutils-build-host-foolos/binutils/readelf mnt/bin + cp ~/temp/fool-os-stuff/ncurses-5.9/progs/tput mnt/bin mkdir -p mnt/etc echo "127.0.0.1 localhost" > mnt/etc/hosts sync diff --git a/userspace/sys/sys.c b/userspace/sys/sys.c index 1ab3579..a9d54ce 100644 --- a/userspace/sys/sys.c +++ b/userspace/sys/sys.c @@ -1,6 +1,7 @@ #include #include #include +#include // CODE FOR Stack Smashing Protector, TODO: MOVE / and do not duplicate @@ -85,3 +86,62 @@ int chown(const char *path, uid_t owner, gid_t group) { return -1; } + +// termios / ncurses +int tcgetattr(int fd, struct termios *termios_p) +{ + return 0; +} +int tcsetattr(int fd, int optional_actions, const struct termios *termios_p){ + return 0; +} +int mkdir(const char *pathname, mode_t mode) +{ + return -1; +} +int chdir (const char *pathname) +{ + return -1; +} + +speed_t cfgetospeed(const struct termios *termios_p) +{ + return 1; +} + +char *ttyname(int fd) +{ + return "foolterm"; +} + + +DIR *opendir(const char *name) +{ + return 0; +} +int closedir(DIR *dirp) +{ + return 0; +} + + +int tcflush(int fd, int queue_selector) +{ + return -1; +} +long fpathconf(int fd, int name) +{ + return -1; +} + + +unsigned int sleep(unsigned int seconds) +{ + return 0; +} + +char *getlogin(void) +{ + return NULL; +} + -- cgit v1.2.3