started the PXE UNDI network device support
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19127 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -22,7 +22,6 @@ local bios_ia32_src =
|
|||||||
bios.S
|
bios.S
|
||||||
console.cpp
|
console.cpp
|
||||||
serial.cpp
|
serial.cpp
|
||||||
devices.cpp
|
|
||||||
keyboard.cpp
|
keyboard.cpp
|
||||||
menu.cpp
|
menu.cpp
|
||||||
mmu.cpp
|
mmu.cpp
|
||||||
@@ -36,6 +35,9 @@ local bios_ia32_src =
|
|||||||
KernelMergeObject boot_platform_pxe_ia32.o :
|
KernelMergeObject boot_platform_pxe_ia32.o :
|
||||||
pxe_stage2.S
|
pxe_stage2.S
|
||||||
smp_trampoline.S
|
smp_trampoline.S
|
||||||
|
devices.cpp
|
||||||
|
network.cpp
|
||||||
|
pxe_undi.cpp
|
||||||
$(bios_ia32_src)
|
$(bios_ia32_src)
|
||||||
|
|
||||||
# generic
|
# generic
|
||||||
|
|||||||
@@ -0,0 +1,84 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2003-2006, Axel Dörfler, [email protected]. All rights reserved.
|
||||||
|
* Copyright 2006, Marcus Overhagen, [email protected]. All rights reserved.
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "bios.h"
|
||||||
|
#include "pxe_undi.h"
|
||||||
|
|
||||||
|
#include <KernelExport.h>
|
||||||
|
#include <boot/platform.h>
|
||||||
|
#include <boot/vfs.h>
|
||||||
|
#include <boot/stdio.h>
|
||||||
|
#include <boot/stage2.h>
|
||||||
|
#include <boot/net/NetStack.h>
|
||||||
|
#include <boot/net/RemoteDisk.h>
|
||||||
|
#include <util/kernel_cpp.h>
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#define TRACE_DEVICES
|
||||||
|
#ifdef TRACE_DEVICES
|
||||||
|
# define TRACE(x...) dprintf(x)
|
||||||
|
#else
|
||||||
|
# define TRACE(x...)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
platform_add_boot_device(struct stage2_args *args, NodeList *devicesList)
|
||||||
|
{
|
||||||
|
TRACE("platform_add_boot_device\n");
|
||||||
|
|
||||||
|
status_t error = net_stack_init();
|
||||||
|
if (error != B_OK)
|
||||||
|
return error;
|
||||||
|
|
||||||
|
// init a remote disk, if possible
|
||||||
|
RemoteDisk *remoteDisk = RemoteDisk::FindAnyRemoteDisk();
|
||||||
|
if (!remoteDisk)
|
||||||
|
return B_ENTRY_NOT_FOUND;
|
||||||
|
|
||||||
|
devicesList->Add(remoteDisk);
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
platform_get_boot_partition(struct stage2_args *args, Node *device,
|
||||||
|
NodeList *list, boot::Partition **_partition)
|
||||||
|
{
|
||||||
|
TRACE("platform_get_boot_partition\n");
|
||||||
|
NodeIterator iterator = list->GetIterator();
|
||||||
|
boot::Partition *partition = NULL;
|
||||||
|
while ((partition = (boot::Partition *)iterator.Next()) != NULL) {
|
||||||
|
// ToDo: just take the first partition for now
|
||||||
|
*_partition = partition;
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
return B_ENTRY_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
platform_add_block_devices(stage2_args *args, NodeList *devicesList)
|
||||||
|
{
|
||||||
|
TRACE("platform_add_block_devices\n");
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
platform_register_boot_device(Node *device)
|
||||||
|
{
|
||||||
|
TRACE("platform_register_boot_device\n");
|
||||||
|
disk_identifier &disk = gKernelArgs.boot_disk.identifier;
|
||||||
|
|
||||||
|
disk.bus_type = UNKNOWN_BUS;
|
||||||
|
disk.device_type = UNKNOWN_DEVICE;
|
||||||
|
disk.device.unknown.size = device->Size();
|
||||||
|
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2006, Marcus Overhagen <[email protected]. All rights reserved.
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <new>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include <OS.h>
|
||||||
|
#include <KernelExport.h>
|
||||||
|
|
||||||
|
#include <boot/net/Ethernet.h>
|
||||||
|
#include <boot/net/NetStack.h>
|
||||||
|
|
||||||
|
#include "pxe_undi.h"
|
||||||
|
|
||||||
|
#define TRACE_NETWORK
|
||||||
|
#ifdef TRACE_NETWORK
|
||||||
|
# define TRACE(x...) dprintf(x)
|
||||||
|
#else
|
||||||
|
# define TRACE(x...)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
platform_net_stack_init()
|
||||||
|
{
|
||||||
|
TRACE("platform_net_stack_init\n");
|
||||||
|
|
||||||
|
pxe_undi_init();
|
||||||
|
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2006, Marcus Overhagen <[email protected]. All rights reserved.
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <OS.h>
|
||||||
|
#include <KernelExport.h>
|
||||||
|
|
||||||
|
#include "pxe_undi.h"
|
||||||
|
|
||||||
|
#define TRACE_UNDI
|
||||||
|
#ifdef TRACE_UNDI
|
||||||
|
# define TRACE(x...) dprintf(x)
|
||||||
|
#else
|
||||||
|
# define TRACE(x...)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
struct pxe_struct
|
||||||
|
{
|
||||||
|
uint32 signature;
|
||||||
|
};
|
||||||
|
|
||||||
|
pxe_struct *gPxeData;
|
||||||
|
|
||||||
|
|
||||||
|
pxe_struct *
|
||||||
|
pxe_undi_find_data()
|
||||||
|
{
|
||||||
|
pxe_struct *data = NULL;
|
||||||
|
for (char *addr = (char *)0x8D000; addr < (char *)0xA0000; addr += 16) {
|
||||||
|
if (*(uint32 *)addr == 'EXP!' /* '!PXE' */) {
|
||||||
|
TRACE("found !PXE at %p\n", addr);
|
||||||
|
data = (pxe_struct *)addr;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
pxe_undi_init()
|
||||||
|
{
|
||||||
|
TRACE("pxe_undi_init\n");
|
||||||
|
|
||||||
|
gPxeData = pxe_undi_find_data();
|
||||||
|
if (!gPxeData)
|
||||||
|
panic("can't find !PXE structure");
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2006, Marcus Overhagen <[email protected]. All rights reserved.
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
void pxe_undi_init();
|
||||||
Reference in New Issue
Block a user