{"id":491,"date":"2009-10-14T16:13:30","date_gmt":"2009-10-14T14:13:30","guid":{"rendered":"http:\/\/raftaman.net\/?p=491"},"modified":"2022-01-29T23:19:17","modified_gmt":"2022-01-29T21:19:17","slug":"booting-freedos-via-pxe","status":"publish","type":"post","link":"https:\/\/possiblelossofprecision.net\/?p=491","title":{"rendered":"Booting FreeDOS via PXE"},"content":{"rendered":"\n<p>Wanted to flash a BIOS lately and noticed that all major mainboard manufactors still use DOS flash utilities? I did. Unfortunately my mainboard isn&#8217;t supported by <a href=\"https:\/\/possiblelossofprecision.net\/?p=430\">flashrom<\/a> yet and a floppy drive wasn&#8217;t available. So, why not use FreeDOS?<br \/>\n<!--more--><\/p>\n<h2>1. Installing packages<\/h2>\n<p>Well, this one is rather easy. Just pull the packages from your yum-repo:<\/p>\n<pre class=\"brush: plain; light: true; title: ; notranslate\" title=\"\">\r\nyum install xinetd tftp-server syslinux\r\n<\/pre>\n<h2>2. Configuring xinetd<\/h2>\n<p>Enabling xinetd (and tftp) is no big deal:<\/p>\n<pre class=\"brush: plain; light: true; title: ; notranslate\" title=\"\">\r\nchkconfig xinetd on\r\nchkconfig tftp on\r\n<\/pre>\n<p>You may want to find out (or adjust) the tftp root path. Simply edit <code>\/etc\/xinetd.d\/tftp<\/code> with your favourite editor and change the line that says <code>server_args = -s \/tftpboot<\/code>. Make sure, the service is restarted after you changed something in the configuration file.<\/p>\n<h2>3. Setting up boot environment<\/h2>\n<p>First, you have to copy the pxelinux kernel and memdisk to your tftp directory. Assuming that your tftp root is <code>\/tftpboot<\/code> (note that Fedora <a href=\"https:\/\/bugzilla.redhat.com\/show_bug.cgi?id=449264\">changed this<\/a> default path in Fedora 9):<\/p>\n<pre class=\"brush: plain; light: true; title: ; notranslate\" title=\"\">\r\ncp \/usr\/lib\/syslinux\/pxelinux.0 \/tftpboot\/\r\ncp \/usr\/lib\/syslinux\/memdisk \/tftpboot\/\r\n<\/pre>\n<p>Second, we create the <code>pxelinux.cfg<\/code> directory and a default configuration file<\/p>\n<pre class=\"brush: plain; light: true; title: ; notranslate\" title=\"\">\r\nmkdir -p \/tftpboot\/pxelinux.cfg\/\r\ntouch \/tftpboot\/pxelinux.cfg\/default\r\ncat &gt;&gt; \/tftpboot\/pxelinux.cfg\/default &lt;&lt;EOF\r\ndefault dos\r\nlabel dos\r\n  kernel memdisk\r\n  append initrd=fdboot.img\r\nEOF\r\n<\/pre>\n<p>And finally, we download the raw image of a minimal FreeDOS boot floppy (fdboot.img) from <a href=\"http:\/\/www.freedos.org\/freedos\/files\/\">http:\/\/www.freedos.org\/freedos\/files\/<\/a><\/p>\n<pre class=\"brush: plain; light: true; title: ; notranslate\" title=\"\">\r\nwget http:\/\/www.ibiblio.org\/pub\/micro\/pc-stuff\/freedos\/files\/distributions\/1.0\/fdboot.img -O \/tftpboot\/fdboot.img\r\n<\/pre>\n<h2>4. Manipulating the image<\/a><\/h2>\n<p>Now we can boot into FreeDOS. But how do we flash the motherboard BIOS? Simply include the BIOS ROM file and the flash utility from your mainboard manufactor into the FreeDOS boot image:<\/p>\n<pre class=\"brush: plain; light: true; title: ; notranslate\" title=\"\">\r\nmount -t vfat -o loop fdboot.img \/mnt\/floppy\r\n<\/pre>\n<p>Copy every file you need for flashing your BIOS (or doing other bullshit) to <code>\/mnt\/floppy<\/code>. Don&#8217;t forget to unmount the image before you boot via PXE.<\/p>\n<p>Resources:<br \/>\n<a href=\"http:\/\/www.terryburton.co.uk\/blog\/2007\/08\/pxe-boot-freedos-with-memdisk-to-flash.html\">http:\/\/www.terryburton.co.uk\/blog\/2007\/08\/pxe-boot-freedos-with-memdisk-to-flash.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Wanted to flash a BIOS lately and noticed that all major mainboard manufactors still use DOS flash utilities? I did. Unfortunately my mainboard isn&#8217;t supported by flashrom yet and a floppy drive wasn&#8217;t available. So, why not use FreeDOS?<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[13,7,85],"class_list":["post-491","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-centos","tag-fedora","tag-pxe"],"_links":{"self":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/491","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=491"}],"version-history":[{"count":15,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/491\/revisions"}],"predecessor-version":[{"id":2311,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/491\/revisions\/2311"}],"wp:attachment":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=491"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=491"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=491"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}