diff options
author | benno <benno@FreeBSD.org> | 2001-10-07 13:22:25 +0000 |
---|---|---|
committer | benno <benno@FreeBSD.org> | 2001-10-07 13:22:25 +0000 |
commit | 994f7977f13d1c6ac31ef785fbbc104972efe7b3 (patch) | |
tree | e41d72af3d7b410a29de1cb1506f5f96b1102823 /sys/boot/ofw/libofw/ofw_net.c | |
parent | c0f87bdb1611f3ab744711a34cfc945ccc336830 (diff) | |
download | FreeBSD-src-994f7977f13d1c6ac31ef785fbbc104972efe7b3.zip FreeBSD-src-994f7977f13d1c6ac31ef785fbbc104972efe7b3.tar.gz |
Mega-patch for OpenFirmware loader support.
- Flesh out ofw_readin routine.
- Add OpenFirmware load and exec routines.
- Make sure memory allocation for the kernel is done correctly.
- Change the way the heap is allocated so as to make it easier to deallocate
when we hand over.
- Add a command to print memory maps similar to the one for ia64.
With this patch, I can now load and hand over to a kernel on my iMac. There
are some problems with OpenFirmware routines failing after the hand over that
still need to be addressed.
Diffstat (limited to 'sys/boot/ofw/libofw/ofw_net.c')
-rw-r--r-- | sys/boot/ofw/libofw/ofw_net.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/boot/ofw/libofw/ofw_net.c b/sys/boot/ofw/libofw/ofw_net.c index 11c8dab..712a457 100644 --- a/sys/boot/ofw/libofw/ofw_net.c +++ b/sys/boot/ofw/libofw/ofw_net.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000 Benno Rice + * Copyright (c) 2000-2001 Benno Rice * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -45,8 +45,8 @@ static int ofwn_probe(struct netif *, void *); static int ofwn_match(struct netif *, void *); static void ofwn_init(struct iodesc *, void *); -static int ofwn_get(struct iodesc *, void *, int, time_t); -static int ofwn_put(struct iodesc *, void *, int); +static int ofwn_get(struct iodesc *, void *, size_t, time_t); +static int ofwn_put(struct iodesc *, void *, size_t); static void ofwn_end(struct netif *); extern struct netif_stats ofwn_stats[]; @@ -89,7 +89,7 @@ ofwn_probe(struct netif *nif, void *machdep_hint) } static int -ofwn_put(struct iodesc *desc, void *pkt, int len) +ofwn_put(struct iodesc *desc, void *pkt, size_t len) { struct ether_header *eh; size_t sendlen; @@ -126,7 +126,7 @@ ofwn_put(struct iodesc *desc, void *pkt, int len) } static int -ofwn_get(struct iodesc *desc, void *pkt, int len, time_t timeout) +ofwn_get(struct iodesc *desc, void *pkt, size_t len, time_t timeout) { time_t t; int length; @@ -196,8 +196,10 @@ ofwn_init(struct iodesc *desc, void *machdep_hint) printf("boot: ethernet address: %s\n", ether_sprintf(desc->myea)); - if ((netinstance = OF_open(path)) == -1) + if ((netinstance = OF_open(path)) == -1) { + printf("Could not open network device.\n"); goto punt; + } #if defined(NETIF_DEBUG) printf("ofwn_init: OpenFirmware instance handle: %08x\n", netinstance); @@ -218,7 +220,7 @@ ofwn_init(struct iodesc *desc, void *machdep_hint) punt: printf("\n"); printf("Could not boot from %s.\n", path); - OF_exit(); + OF_enter(); } static void |