From owner-freebsd-hackers Sat Jan 16 18:38:25 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA22015 for freebsd-hackers-outgoing; Sat, 16 Jan 1999 18:38:25 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from sims-ha.videotron.net (faure.videotron.net [205.151.222.100]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA22009 for ; Sat, 16 Jan 1999 18:38:24 -0800 (PST) (envelope-from sepotvin@videotron.ca) Received: from videotron.ca (ppp050.104.mmtl.videotron.net) by sims-ha.videotron.net (Sun Internet Mail Server sims.3.5.1998.09.21.23.34) with ESMTP id <0F5O00GACNAL6T@sims-ha.videotron.net> for Hackers@Freebsd.org; Sat, 16 Jan 1999 21:37:35 -0500 (EST) Date: Sat, 16 Jan 1999 21:37:32 -0500 From: "Stephane E. Potvin" Subject: Re: New bootloader and network iface To: Mike Smith , Hackers@FreeBSD.ORG Message-id: <36A14CEC.5B57D680@videotron.ca> Organization: Galea Network Security MIME-version: 1.0 X-Mailer: Mozilla 4.07 [en] (X11; I; FreeBSD 3.0-CURRENT i386) Content-type: MULTIPART/MIXED; BOUNDARY="Boundary_(ID_K78XnBrKi0QGreU1scT0Cw)" References: <199812180212.SAA00576@dingo.cdrom.com> <36859F9F.5B8DAFF@videotron.ca> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG This is a multi-part message in MIME format. --Boundary_(ID_K78XnBrKi0QGreU1scT0Cw) Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit I guess that my previous post got overlooked in the mayhem on the list just before new years eve or that I was less that clearer with my questions. So here is a new rephrased version which I hope will be a little clearer. I'm currently trying to add remote booting to the bootloader (i386) for a pet project that I'm currently working on. I first stumbled on the fact that as soon as I tried to add a new netif_driver entry I got the following error: zfree (0x,2048): wild pointer I guess from the code around line 153 of the zalloc.c file of the stand library that the start of the heap must be MEMNODE_SIZE_MASK+1 aligned. Am I completely off-track??? I attached the patch I'm using to fix this. It patches the file /usr/src/sys/boot/i386/loader/main.c Ok, here comes the real question. How does the match mechanism work. I understand very well that it is a vague question but I just doesn't seems to be able to just grasp how it is supposed to work. A general explanation of the motives behind this would probably be enough. Is the lsdev function expected to list the network booting devices available? Currently, the probing of the network devices happens only upon the actual opening of the device. I guess I could move it to the initialization of the network devsw entry if wanted/expected. I've got one last question. What is the preferred way to access the pci configuration space. Must I use the biospcipnphandler to check if the card is there and if so use the pci bios functions to retreive the data. Or, on the other hand, can I use the pci config registers to scan the bus myself. I know that both of these approachs would be feasible, I just want to know which one would be the most politically correct. I'm personnaly more enclined to use the second one because I have no knowledge whatsoever of the pci bios but I know pretty well how to do manual pci bus probing/configuration. Thanks in advance! Stephane E. Potvin Galea Network Security --Boundary_(ID_K78XnBrKi0QGreU1scT0Cw) Content-type: text/plain; name=main.c.diff; charset=us-ascii Content-disposition: inline; filename=main.c.diff Content-transfer-encoding: 7bit *** main.c.orig Sat Jan 16 21:11:30 1999 --- main.c Sat Jan 16 21:10:54 1999 *************** *** 32,37 **** --- 32,38 ---- */ #include + #include #include #include #include *************** *** 71,76 **** --- 72,78 ---- main(void) { int i; + u_int32_t aligned_end; /* Pick up arguments */ kargs = (void *)__args; *************** *** 82,89 **** * Initialise the heap as early as possible. Once this is done, malloc() is usable. * * XXX better to locate end of memory and use that */ ! setheap((void *)end, (void *)(end + (384 * 1024))); /* * XXX Chicken-and-egg problem; we want to have console output early, but some --- 84,94 ---- * Initialise the heap as early as possible. Once this is done, malloc() is usable. * * XXX better to locate end of memory and use that + * + * heap start must be MEMNODE_SIZE_MASK aligned for zfree to work */ ! aligned_end = ((u_int32_t) end + MEMNODE_SIZE_MASK) & ~MEMNODE_SIZE_MASK; ! setheap ((void *) aligned_end, (void *) (aligned_end + (384 * 1024))); /* * XXX Chicken-and-egg problem; we want to have console output early, but some --Boundary_(ID_K78XnBrKi0QGreU1scT0Cw)-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message