Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KQDLN-00033D-Tt for mharc-grub-devel@gnu.org; Mon, 04 Aug 2008 23:36:17 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KQDLL-00032m-Ka for grub-devel@gnu.org; Mon, 04 Aug 2008 23:36:15 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KQDLK-00032L-2M for grub-devel@gnu.org; Mon, 04 Aug 2008 23:36:15 -0400 Received: from [199.232.76.173] (port=58992 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KQDLJ-00032I-Vl for grub-devel@gnu.org; Mon, 04 Aug 2008 23:36:13 -0400 Received: from ti-out-0910.google.com ([209.85.142.188]:57489) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KQDLI-0002S2-GX for grub-devel@gnu.org; Mon, 04 Aug 2008 23:36:13 -0400 Received: by ti-out-0910.google.com with SMTP id u5so568492tia.10 for ; Mon, 04 Aug 2008 20:36:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=OPvJ7JDSGTx5ZAFpYgVg+ussepLhSejNo3kZ96bQLYI=; b=UuyVNnO5/mn+5vP3DLxjsRuKIY268SSQhKYaBJYZWPH4SQF+/Szky4VM8T36fzWZRm a04it/NIHMIXXu+OIuky+4ouutXjEhZNqreD4D6YfB8ib5sQDpdqJyxGNxJ+I0CMDtNK t7gXt4zBQSr0yDjsOaKCGDdEXNGvyNCCm+RE0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=P9z/1g2LaXaGUUX2dJroZuzqmJr+YRvJJbk+n+V12SMctnR/vQNsDEzxcNiQlI/O67 8xuS2vcH0X7xc29pjeGtmJnxk5LuJOPjotwAhbKK5APybRzABKt/i200JnXO+SyoazZ2 kLoF0mBgN5VsCgyvg+3vcMgSK6g0WVWsoZxuA= Received: by 10.110.8.5 with SMTP id 5mr300346tih.3.1217907366130; Mon, 04 Aug 2008 20:36:06 -0700 (PDT) Received: by 10.110.16.5 with HTTP; Mon, 4 Aug 2008 20:36:06 -0700 (PDT) Message-ID: Date: Tue, 5 Aug 2008 11:36:06 +0800 From: Bean To: "The development of GRUB 2" In-Reply-To: <87abfs32u9.fsf@xs4all.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <87abfs32u9.fsf@xs4all.nl> X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) Subject: Re: [PATCH] PXE support for grub2 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2008 03:36:15 -0000 On Tue, Aug 5, 2008 at 5:08 AM, Marco Gerards wrote: > Actually, I would prefer: > > pxe --info > > pxe --blksize=size > > pxe --unload > > You kinda reimplemented an argument parser. The advantage of the > build in argument parser is that it supports generation of --help > documentation and it supports tab completion. Ok. >> >> /* Root drive will default to boot drive */ >> - movb $0xFF, %dh >> + movb $0xFF, %dh >> + movb $0x7F, %dl > > Please update the copyright year of files you change. IIRC this file > is not from this year. I often forget to mention this, but it applies > in general. > > Oh, I forget that. >> + c.buffer = SEGOFS (GRUB_MEMORY_MACHINE_SCRATCH_ADDR); >> + while (pn >= data->packet_number) >> + { >> + c.buffer_size = grub_pxe_blksize; >> + grub_pxe_call (GRUB_PXENV_TFTP_READ, &c); >> + if (c.status) >> + { >> + grub_error (GRUB_ERR_BAD_FS, "read fails"); >> + return -1; >> + } >> + data->packet_number++; >> + } >> + >> + grub_memcpy (buf, (char *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR, len); > > Is it save to use this memory? > This is only used by the real mode service. Once the data is retrieved, it's copied to another buffer. >> +GRUB_MOD_INIT(pxe) >> +{ >> + (void) mod; /* To stop warning. */ >> + >> + grub_pxe_detect (); >> + if (grub_pxe_pxenv) >> + { >> + grub_disk_dev_register (&grub_pxe_dev); >> + grub_fs_register (&grub_pxefs_fs); > > filesystems belong in fs/ Perhaps I should place it in fs/i386/pc ? >> +struct grub_pxenv >> +{ >> + grub_uint8_t signature[6]; /* 'PXENV+' */ >> + grub_uint16_t version; /* MSB = major, LSB = minor */ >> + grub_uint8_t length; /* structure length */ >> + grub_uint8_t checksum; /* checksum pad */ >> + grub_uint32_t rm_entry; /* SEG:OFF to PXE entry point */ >> + grub_uint32_t pm_offset; /* Protected mode entry */ >> + grub_uint16_t pm_selector; /* Protected mode selector */ >> + grub_uint16_t stack_seg; /* Stack segment address */ >> + grub_uint16_t stack_size; /* Stack segment size (bytes) */ >> + grub_uint16_t bc_code_seg; /* BC Code segment address */ >> + grub_uint16_t bc_code_size; /* BC Code segment size (bytes) */ >> + grub_uint16_t bc_data_seg; /* BC Data segment address */ >> + grub_uint16_t bc_data_size; /* BC Data segment size (bytes) */ >> + grub_uint16_t undi_data_seg; /* UNDI Data segment address */ >> + grub_uint16_t undi_data_size; /* UNDI Data segment size (bytes) */ >> + grub_uint16_t undi_code_seg; /* UNDI Code segment address */ >> + grub_uint16_t undi_code_size; /* UNDI Code segment size (bytes) */ >> + grub_uint32_t pxe_ptr; /* SEG:OFF to !PXE struct */ >> +} __attribute__ ((packed)); > > Can you GRUB-ify the comments here and below a bit? What do you mean by "GRUB-ify the comments" ? -- Bean