aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorMarvin Borner2020-11-09 22:18:55 +0100
committerMarvin Borner2020-11-09 22:18:55 +0100
commitb20fdcfe67ea56c47bfe1e059b504fae73bc52b3 (patch)
tree89ddaad40a3fcd601f2bdbd7cee0e71f66944fd7 /kernel
parent49da2ac6b70a107c22c784b48e4ae332128f684c (diff)
Removed non-net support and fixed some bugs
Diffstat (limited to 'kernel')
-rw-r--r--kernel/Makefile2
-rw-r--r--kernel/features/net.c13
2 files changed, 8 insertions, 7 deletions
diff --git a/kernel/Makefile b/kernel/Makefile
index cca186c..36aa9ee 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -24,7 +24,7 @@ OC = ccache ../cross/opt/bin/i686-elf-objcopy
AS = ccache nasm
WARNINGS = -Wall -Wextra -pedantic-errors -Wshadow -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wnested-externs -Wno-long-long
-CFLAGS = $(WARNINGS) -Wno-address-of-packed-member -nostdlib -nostdinc -ffreestanding -fno-builtin -mno-red-zone -mgeneral-regs-only -std=c99 -m32 -Wl,-ekernel_main -I../libc/inc/ -Iinc/ -Dkernel $(CFLAGS_EXTRA) $(OPTIMIZATION)
+CFLAGS = $(WARNINGS) -Wno-address-of-packed-member -nostdlib -nostdinc -ffreestanding -fno-builtin -mno-red-zone -mgeneral-regs-only -std=c99 -m32 -Wl,-ekernel_main -I../libc/inc/ -Iinc/ -Dkernel $(CFLAGS_EXTRA) $(OPTIMIZATION) $(DEBUG)
ASFLAGS = -f elf32
all: compile
diff --git a/kernel/features/net.c b/kernel/features/net.c
index 19b76bc..3c1d620 100644
--- a/kernel/features/net.c
+++ b/kernel/features/net.c
@@ -424,7 +424,6 @@ void tcp_handle_packet(struct tcp_packet *packet, u32 dst, int len)
/* tcp->ack_no += strlen(http_req); */
- print("Setting to 5!\n");
tcp->state = 5; // TODO: TCP enum state machine
return;
} else if (tcp->state == 5 && (flags & 0xff) == TCP_FLAG_ACK) {
@@ -653,11 +652,13 @@ void net_send(struct socket *socket, void *data, u32 len)
void net_install(void)
{
- if (rtl8139_install()) {
- sti();
- arp_lookup_add(broadcast_mac, 0xffffffff);
- dhcp_discover();
- }
+ if (!rtl8139_install())
+ return;
+
+ sti();
+
+ arp_lookup_add(broadcast_mac, 0xffffffff);
+ dhcp_discover();
tcp_sockets = list_new();
udp_sockets = list_new();