From e2005fda57ea4da12754d67ba127b09508125395 Mon Sep 17 00:00:00 2001 From: Miguel Date: Wed, 10 Oct 2018 21:54:10 +0200 Subject: cross compiling struggles --- userspace/Makefile | 10 +++++++++- userspace/clear.c | 9 --------- userspace/myclear.c | 9 +++++++++ userspace/ncurses/Makefile | 10 ++++++++++ userspace/ncurses/ncurs.c | 13 +++++++++++++ 5 files changed, 41 insertions(+), 10 deletions(-) delete mode 100644 userspace/clear.c create mode 100644 userspace/myclear.c create mode 100644 userspace/ncurses/Makefile create mode 100644 userspace/ncurses/ncurs.c (limited to 'userspace') diff --git a/userspace/Makefile b/userspace/Makefile index f7d0ae5..dc5509c 100644 --- a/userspace/Makefile +++ b/userspace/Makefile @@ -1,4 +1,4 @@ -IMAGESIZE=40000 #ext2.img size in Kb +IMAGESIZE=60000 #ext2.img size in Kb ####################### @@ -36,6 +36,7 @@ ext2.img: $(PROGS) make -C fonts make -C xterm make -C cpp + make -C ncurses @echo "----------------------" @echo "Creating ext2.img ...." @dd if=/dev/zero of=ext2.img bs=1024 count=$(IMAGESIZE) @@ -54,6 +55,8 @@ ext2.img: $(PROGS) @cp fonts/binfont.bin mnt/doc/fonts @cp xterm/xterm mnt/bin @cp cpp/testcpp mnt/bin + @cp ncurses/ncurs mnt/bin + @cp /home/miguel/temp/foolos/usr/bin/* mnt/bin # cp ~/temp/fool-os-stuff/binutils-build-host-foolos/binutils/readelf mnt/bin # cp ../font/binfont.bin mnt/ @@ -77,6 +80,11 @@ clean: make -C fonts clean make -C xterm clean make -C cpp clean + make -C ncurses clean @echo "Cleaning userspace ..."; rm -f *.o $(PROGS) ext2.img *.d +umount: + sudo umount mnt + rm mnt -r + new: clean all diff --git a/userspace/clear.c b/userspace/clear.c deleted file mode 100644 index 1c794b8..0000000 --- a/userspace/clear.c +++ /dev/null @@ -1,9 +0,0 @@ -/** clear our console */ - -#include -int main() -{ - printf("\033c"); - fflush(stdout); // force printing to console - return 0; -} diff --git a/userspace/myclear.c b/userspace/myclear.c new file mode 100644 index 0000000..1c794b8 --- /dev/null +++ b/userspace/myclear.c @@ -0,0 +1,9 @@ +/** clear our console */ + +#include +int main() +{ + printf("\033c"); + fflush(stdout); // force printing to console + return 0; +} diff --git a/userspace/ncurses/Makefile b/userspace/ncurses/Makefile new file mode 100644 index 0000000..4a8fc56 --- /dev/null +++ b/userspace/ncurses/Makefile @@ -0,0 +1,10 @@ +CC=i686-foolos-gcc +AS=i686-foolos-as + +LDLIBS=-lncurses -lcurses +CFLAGS=-static + +ncurs: + +clean: + rm -f *.o ncurs diff --git a/userspace/ncurses/ncurs.c b/userspace/ncurses/ncurs.c new file mode 100644 index 0000000..6edf8e6 --- /dev/null +++ b/userspace/ncurses/ncurs.c @@ -0,0 +1,13 @@ +#include + +int main() +{ + +// initscr(); /* Start curses mode */ +// printw("Hello World !!!"); /* Print Hello World */ +// refresh(); /* Print it on to the real screen */ +// getch(); /* Wait for user input */ +// endwin(); /* End curses mode */ + + return 0; +} -- cgit v1.2.3