Skip to content

Commit

Permalink
Networking Broken
Browse files Browse the repository at this point in the history
  • Loading branch information
maxtyson123 committed Dec 3, 2023
1 parent 09f3b98 commit ce21e1e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 17 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,13 @@ Kernel Cleanup
- [x] VESA Video Mode
- [x] Kernel Boot Rewrite
- [x] Rewrite Event Handlers
- [x] Network Touch Up
- [ ] Custom Toolchain
- [ ] Network Touch Up - Fix Issues with IP, Get it working on QEMU
- [ ] DCHP protocol
- [ ] GUI Bug Fixes
- [ ] Better Commenting and Doxygen Documentation
- [ ] Use better c++ coding conventions
- [ ] Fix filesystem (move to linux one?)
- [ ] HTTP Protocol
- [ ] USB
- [ ] Custom Toolchain
- [ ] CMAKE Build System (and maybe get it building and debugging in CLion)
- [ ] Clean up all the TODOs

Expand Down
4 changes: 2 additions & 2 deletions kernel/include/net/ipv4.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ namespace maxOS{
void Send(InternetProtocolAddress destinationIP, common::uint8_t* payloadData, common::uint32_t size);
};

class InternetProtocolHandler : public net::EthernetFramePayloadHandler{
class InternetProtocolHandler : public EthernetFramePayloadHandler{

friend class InternetProtocolAddressResolver;

Expand All @@ -84,7 +84,7 @@ namespace maxOS{
common::OutputStream* errorMessages);
~InternetProtocolHandler();

bool handleEthernetframePayload(common::uint8_t* ethernetframePayload, common::uint32_t size);
bool handleEthernetframePayload(common::uint8_t* ethernetframePayload, common::uint32_t size) override;
void sendInternetProtocolPacket(common::uint32_t dstIP_BE, common::uint8_t protocol, common::uint8_t* data, common::uint32_t size);

static common::uint16_t Checksum(common::uint16_t* data, common::uint32_t lengthInBytes);
Expand Down
8 changes: 1 addition & 7 deletions kernel/src/kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ extern "C" void kernelMain(const multiboot_info& multibootHeader, uint32_t multi


// Run the network
#define NETWORK
//#define NETWORK
#ifdef NETWORK

// TCPtoStream
Expand Down Expand Up @@ -498,10 +498,4 @@ extern "C" void kernelMain(const multiboot_info& multibootHeader, uint32_t multi
while (true);
}




#pragma clang diagnostic pop

//MaxOS - May the source be with you...
//TODO: Fix networking later TCP/UDP listening, - sending works
8 changes: 4 additions & 4 deletions kernel/src/net/ethernetframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ bool EthernetFrameHandler::DataReceived(common::uint8_t* buffer, common::uint32_
bool sendBack = false;

//Only handle if it is for this device
if(frame->destinationMAC == 0xFFFFFFFFFFFF //If it is a broadcast
if(frame->destinationMAC == 0xFFFFFFFFFFFF //If it is a broadcast
|| frame->destinationMAC == ethernetDriver -> GetMediaAccessControlAddress()) //If it is for this device
{

Expand All @@ -102,13 +102,13 @@ bool EthernetFrameHandler::DataReceived(common::uint8_t* buffer, common::uint32_
// If the handler is found
if(handlerIterator != frameHandlers.end()) {


//TODO: The override is not being called (IDK WHY)

//Handle the data
errorMessages -> write("EFH: Handling ethernet frame payload\n");
// TODO: This doesnt call the override
sendBack = handlerIterator->second->handleEthernetframePayload(buffer + sizeof(EthernetFrameHeader), size - sizeof(EthernetFrameHeader));
errorMessages -> write("..DONE\n");
if(sendBack)
errorMessages -> write("EFH: Sending back\n");

} else {

Expand Down

0 comments on commit ce21e1e

Please sign in to comment.