PXE Boot, please need a little guidance

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
c0delicious
Posts: 2
Joined: Thu Sep 15, 2011 10:02 pm
Location: FL
Contact:

PXE Boot, please need a little guidance

Post 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.
Regards,
[c0dr]
intx13
Member
Member
Posts: 112
Joined: Wed Sep 07, 2011 3:34 pm

Re: PXE Boot, please need a little guidance

Post 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?
shikhin
Member
Member
Posts: 274
Joined: Sat Oct 09, 2010 3:35 am
Libera.chat IRC: shikhin
Contact:

Re: PXE Boot, please need a little guidance

Post 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
http://shikhin.in/

Current status: Gandr.
c0delicious
Posts: 2
Joined: Thu Sep 15, 2011 10:02 pm
Location: FL
Contact:

Re: PXE Boot, please need a little guidance

Post 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!
Regards,
[c0dr]
shikhin
Member
Member
Posts: 274
Joined: Sat Oct 09, 2010 3:35 am
Libera.chat IRC: shikhin
Contact:

Re: PXE Boot, please need a little guidance

Post 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
http://shikhin.in/

Current status: Gandr.
User avatar
Chandra
Member
Member
Posts: 487
Joined: Sat Jul 17, 2010 12:45 am

Re: PXE Boot, please need a little guidance

Post by Chandra »

That Wiki Page looks good. Good job!
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
shikhin
Member
Member
Posts: 274
Joined: Sat Oct 09, 2010 3:35 am
Libera.chat IRC: shikhin
Contact:

Re: PXE Boot, please need a little guidance

Post 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
http://shikhin.in/

Current status: Gandr.
Post Reply