summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Idziorek <m.i@gmx.at>2014-12-02 12:39:30 +0100
committerMichal Idziorek <m.i@gmx.at>2014-12-02 12:39:30 +0100
commitedbcac06e490731c923ddd18d948fa76dc3ee9b7 (patch)
tree53ae6b138f317d61caaa9f52f7fbc0ff21a933f6
parentb4e8da9b6e43366eaa7198f349ce30421c1d7bf1 (diff)
Adapt for ncurses
-rw-r--r--userspace/Makefile1
-rw-r--r--userspace/sys/sys.c60
2 files changed, 61 insertions, 0 deletions
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 <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/termios.h>
// 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;
+}
+