Page 1 of 1

PXE Boot, please need a little guidance

Posted: Thu Sep 15, 2011 11:22 pm
by c0delicious
First of all, this is my first post in the forum and would like to dedicate the first line to congratulate osdev.org for having an awsome community.

Recently I been writing a PXE Net Bootstrap Program to load my kernel into my recently bought server, this is due to the fact that it does not contains a CD-ROM and really PXE is on my TODO list. I read that you can use GRUB or syslinux for this but, using other people's stuff is not as fun as rolling your own :wink:.

my problem is the following: (please note I searched the forum and the whole site as the forum rules indicates)

So far I'm able to make API calls to open and read from the TFTP server. my kernel is about 1MB is size, but the API TFTP Read call is loading only 512 bytes from the server into my buffer. In the TFTP Read parameter structure I'm setting the buffer size parameter to the value retrieved from the TFTP Open parameter structure after been called.

my question is, how can I do to download the whole kernel?

please any suggestions or ideas are greatly appreciated!

Thanks.

Re: PXE Boot, please need a little guidance

Posted: Fri Sep 16, 2011 5:21 am
by intx13
What "API" are you referring to?

The TFTP server will return data in chunks of 512 bytes. Are you ACKing the first chunk properly?

Re: PXE Boot, please need a little guidance

Posted: Fri Sep 16, 2011 5:58 am
by shikhin
Hi,

I've tried starting a better article on PXE on the wiki. Here is what I've done till now http://wiki.osdev.org/PXE. It's not the best I could do, but I'll be improving over it. Currently, the Reading subsection should contain enough to help you solve your problems.

Regards,
Shikhin

Re: PXE Boot, please need a little guidance

Posted: Fri Sep 16, 2011 11:02 am
by c0delicious
Thanks intx13 and Shikhin for the response.

I read your very helpful wiki page and following what it says, I got to download all the bytes, thank you very much for the guidance. can't wait to jump into my kernel!

I believe my next steps are to unload the Base Code Stack to free some memory, Clean up and Stop UNDI to unhook the 1Ah service and free some memory, restore the BIOS Stack, and jmp to the kernel, right ?

Thanks again!

Re: PXE Boot, please need a little guidance

Posted: Fri Sep 16, 2011 9:49 pm
by shikhin
Hi,
c0delicious wrote:I believe my next steps are to unload the Base Code Stack to free some memory, Clean up and Stop UNDI to unhook the 1Ah service and free some memory
I wouldn't trust myself with the Cleaning part (which I haven't yet implemented myself), and I'd be copying it off from Diskless booting :D
c0delicious wrote:restore the BIOS Stack
Erm, the BIOS Stack? I think you mean to leave the stack PXE gave you, and make yourself a new stack? Or?
c0delicious wrote:and jmp to the kernel, right?
Of course, if you've enabled A20, gathered the memory map, Video Mode information, and any other thing you might want to do (perhaps copying the Kernel to a higher address, enabling Paging, etc).
c0delicious wrote:Thanks again!
Welcome. :)

Regards,
Shikhin

Re: PXE Boot, please need a little guidance

Posted: Fri Sep 16, 2011 10:37 pm
by Chandra
That Wiki Page looks good. Good job!

Re: PXE Boot, please need a little guidance

Posted: Fri Sep 16, 2011 10:51 pm
by shikhin
Chandra wrote:That Wiki Page looks good. Good job!
Thanks! :)

I was lazy, and left out writing the Cleaning portion in detail, and perhaps someone could cover TFTP_READ_FILE (or whatever it was named) too.

Regards,
Shikhin