diff options
Diffstat (limited to 'net')
| -rw-r--r-- | net/Makefile | 92 | ||||
| -rw-r--r-- | net/eth.c | 2 | ||||
| -rw-r--r-- | net/icmp.c | 6 | ||||
| -rw-r--r-- | net/net_sys.h | 7 | ||||
| -rw-r--r-- | net/udp.h | 2 |
5 files changed, 103 insertions, 6 deletions
diff --git a/net/Makefile b/net/Makefile new file mode 100644 index 0000000..b8ab2b6 --- /dev/null +++ b/net/Makefile @@ -0,0 +1,92 @@ + + ############## + # Fool Stack # + ############## + +############ compiler ############ + +#use our cross compiler +CC=i686-foolos-gcc +AS=i686-foolos-as + +#sorry just this +CC=i686-elf-gcc +AS=i686-elf-as + +############ compiler flags ############ + + +#https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html + +CFLAGS= +#CFLAGS+=-fvar-tracking +#CFLAGS+=-DGIT_REVISION=\"$(GIT_REVISION)\" +CFLAGS+=-ffreestanding # do we need this if using own compiler? +CFLAGS+=-nostdlib +#CFLAGS+=-Og +CFLAGS+=-O0 +#CFLAGS+=-I. +#CFLAGS+=-I/home/miguel/temp/foolos/usr/i686-foolos/include/ +#CFLAGS+=-I./asm +#CFLAGS+=-I./kernel +#CFLAGS+=-I./driver +#CFLAGS+=-I./fs +CFLAGS+=-gstabs + +#CFLAGS+=-fstack-protector-all +#CFLAGS+=-fno-zero-initialized-in-bss +#CFLAGS+=-fdata-sections -ffunction-sections + +#CFLAGS+= -w # disable all warnings +#CFLAGS+= -Wimplicit-function-declaration +CFLAGS+= -Wall +#CFLAGS+= -Wextra +#CFLAGS+= -pedantic +CFLAGS+= -Werror +CFLAGS+= -Werror=implicit-function-declaration + +CFLAGS+= -Wno-unused-variable +CFLAGS+= -Wno-unused-function +CFLAGS+= -Wno-int-conversion +CFLAGS+= -Wno-implicit-int +CFLAGS+= -Wno-incompatible-pointer-types +CFLAGS+= -Wno-discarded-qualifiers +CFLAGS+= -Wno-unused-but-set-variable + +#CFLAGS+ = -Wall -Wextra -std=c89 -pedantic -Wmissing-prototypes -Wstrict-prototypes -Wold-style-definition + +######## linker flags #################### +LDFLAGS= +LDLIBS+=-lgcc + +########## assembler flags ################# +ASFLAGS= +ASFLAGS+=-gstabs + +########## verbosity ##################3 +#V = 0 +#CC = @echo "Compiling (i686-elf-gcc) $<..."; i686-elf-gcc +#AS = @echo "Assembling (i686-elf-as) $<..."; i686-elf-as +#CC_1 = $(CCC) +#CC = $(CC_$(V)) + +############ source and object files and their deps ############ + +#source files +SOURCES= +SOURCES+=$(wildcard *.c) + +#derive object files +OBJECTS=$(patsubst %.c, %.o, $(SOURCES)) + +#derive and include deps +DEPS=$(patsubst %.c, %.d, $(SOURCES)) + +-include $(DEPS) + +tags: + @echo "Generating ctags..."; ctags --recurse=yes . + +clean: + @echo "Cleaning..."; rm -f *.d *.o tags + @@ -1,7 +1,7 @@ +#include "net_sys.h" #include "inet.h" #include "eth.h" #include "netdev.h" -#include "lib/string/string.h" uint32_t eth_generic(struct netdev *dev, uint32_t ip, uint16_t type, uint8_t* pos,uint32_t *end) { @@ -1,10 +1,8 @@ +#include "net_sys.h" + #include "inet.h" #include "icmp.h" #include "ipv4.h" -#include "log.h" -#include "kmalloc.h" - -#include "lib/string/string.h" uint32_t icmp_generic(struct netdev *dev, uint32_t ip, uint8_t type, uint8_t* pos,uint8_t *end) { diff --git a/net/net_sys.h b/net/net_sys.h new file mode 100644 index 0000000..a296b41 --- /dev/null +++ b/net/net_sys.h @@ -0,0 +1,7 @@ +/** + * @file + * + * this has to be provided and linked against the fool stack + */ + +void* memcpy(void* restrict dstptr, const void* restrict srcptr, int size); @@ -1,5 +1,5 @@ -#include "netdev.h" #include <stdint.h> +#include "netdev.h" struct udp_v4{ uint16_t src_port; |
