aboutsummaryrefslogtreecommitdiff
path: root/kernel/inc
diff options
context:
space:
mode:
authorMarvin Borner2020-09-21 22:00:40 +0200
committerMarvin Borner2020-09-21 22:00:40 +0200
commit0e9abba93578786e774525dfdf02c59194d3e1e5 (patch)
treee7df565030ebfc4d334ca142e005351ffd293cd6 /kernel/inc
parent02d97dcb1ea14c963219f22aed24b297e8366d05 (diff)
Frustration
Diffstat (limited to 'kernel/inc')
-rw-r--r--kernel/inc/ide.h3
-rw-r--r--kernel/inc/net.h27
2 files changed, 28 insertions, 2 deletions
diff --git a/kernel/inc/ide.h b/kernel/inc/ide.h
index e88a6d7..c145760 100644
--- a/kernel/inc/ide.h
+++ b/kernel/inc/ide.h
@@ -21,7 +21,7 @@
#define IDE_LOW 0x3
#define IDE_MID 0x4
#define IDE_HIGH 0x5
-#define IDE_HEAD 0x6
+#define IDE_SELECT 0x6
#define IDE_CMD 0x7
#define IDE_ALTERNATE 0x3F6
@@ -35,7 +35,6 @@
#define IDE_CMD_READ_MUL 0xC4
#define IDE_CMD_WRITE_MUL 0xC5
-int ide_wait(int check);
void *ide_read(void *b, u32 block);
#endif
diff --git a/kernel/inc/net.h b/kernel/inc/net.h
index 11b94e5..f3876e9 100644
--- a/kernel/inc/net.h
+++ b/kernel/inc/net.h
@@ -3,9 +3,36 @@
#ifndef NET_H
#define NET_H
+#include <def.h>
+
#define RTL8139_VENDOR_ID 0x10ec
#define RTL8139_DEVICE_ID 0x8139
+#define RTL_PORT_MAC 0x00
+#define RTL_PORT_MAR 0x08
+#define RTL_PORT_TXSTAT 0x10
+#define RTL_PORT_TXBUF 0x20
+#define RTL_PORT_RBSTART 0x30
+#define RTL_PORT_CMD 0x37
+#define RTL_PORT_RXPTR 0x38
+#define RTL_PORT_RXADDR 0x3A
+#define RTL_PORT_IMR 0x3C
+#define RTL_PORT_ISR 0x3E
+#define RTL_PORT_TCR 0x40
+#define RTL_PORT_RCR 0x44
+#define RTL_PORT_RXMISS 0x4C
+#define RTL_PORT_CONFIG 0x52
+
+#define ETHERNET_TYPE_IP 0x0800
+#define ETHERNET_TYPE_ARP 0x0806
+
+struct ethernet_packet {
+ u8 dst_mac_addr[6];
+ u8 src_mac_addr[6];
+ u16 type;
+ u8 data[];
+} __attribute__((packed));
+
void net_install();
#endif