DaemonForums  

Go Back   DaemonForums > Miscellaneous > Guides

Guides All Guides and HOWTO's.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 13th March 2009
vermaden's Avatar
vermaden vermaden is offline
Administrator
 
Join Date: Apr 2008
Location: pl_PL.lodz
Posts: 1,056
Post HOWTO: Update BIOS Using CD

Its a lot more comfortable to update the BIOS by using generated ISO image with all needed files to update, then to struggle with old floppies, which you also not always can use, below is a script that generates bootable ISO image called cd.iso, you can burn it and use it to update you BIOS.

I also attached bootable floppy image __bootable.img that is needed to create such bootable ISO, which you need to gunzip and put in the same place as the script.

Code:
#! /bin/sh

BOOT=__bootdisk.img

if [ ${#} -eq 0 ]
then
  echo "usage: $( basename ${0} ) BIOS.rom FLASH.exe ..."
  exit 1
fi

mkisofs -J -R -b ${BOOT} -o cd.iso ${BOOT} $@
Attached Files
File Type: gz __bootdisk.img.gz (739.8 KB, 869 views)
__________________
religions, worst damnation of mankind
"If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds

Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”.
vermaden's: links resources deviantart spreadbsd
Reply With Quote
  #2   (View Single Post)  
Old 11th March 2010
vermaden's Avatar
vermaden vermaden is offline
Administrator
 
Join Date: Apr 2008
Location: pl_PL.lodz
Posts: 1,056
Default

An update to the method used before, previously I used MS-DOS 1.44 MB bootable floppy and added BIOS files to CD-ROM image, so an emulated floppy needed to load CD-ROM driver and then you was able to flash the BIOS. Now I use open/free 2.88 MB floppy with FreeDOS instead, and BIOS files are kept directly on the emulated floppy, so no need to load all these CD-ROM drivers, so it also boots a lot faster.

The script itself is here:
Code:
#! /bin/sh

trap __clean 1 2 3 4 5 6 7 8 9 10 11 12 14 15

# bootable 2.88 MB floppy image from: http://fdos.org/bootdisks/
FLOPPY=FDSTD.288

__status() {
  [ ${?} -eq 0 ] || {
    echo "ER: ${@}"
    exit 1
    }
  }

__clean() {
  cd /
  umount mnt 1> /dev/null 2> /dev/null
  UNIT=$( echo ${UNIT} | tr -d 'a-z' 2> /dev/null )
  mdconfig -d -u ${UNIT} 1> /dev/null 2> /dev/null
  }

[ ${USER} = root ] || {
  echo "ER: only root may use that script"
  exit 1
  }

for I in fetch gzip mdconfig mkdir mount_msdosfs cp umount rm tr mkisofs
do
  which ${I} 1> /dev/null 2> /dev/null || {
    echo "ER: ${I} is not available in ${PATH}"
    exit 1
    }
done

fetch http://www.fdos.org/bootdisks/autogen/${FLOPPY}.gz 1> /dev/null 2> /dev/null
__status "fetch(1) failed"

gzip -d -f ${FLOPPY}.gz 1> /dev/null 2> /dev/null
__status "gzip(1) failed"

UNIT=$( mdconfig -a -t vnode -f ${FLOPPY} 2> /dev/null )
__status "mdconfig(8) failed (create)"

mkdir -p mnt 1> /dev/null 2> /dev/null
__status "mkdir(1) failed"

mount_msdosfs /dev/${UNIT} mnt 1> /dev/null 2> /dev/null
__status "mount(8) failed"

cp bios/* mnt 1> /dev/null 2> /dev/null
__status "cp(1) failed"

umount mnt 1> /dev/null 2> /dev/null
__status "umount(8) failed"

rm -r mnt 1> /dev/null 2> /dev/null
__status "rm(1) failed"

UNIT=$( echo ${UNIT} | tr -d 'a-z' 2> /dev/null )
__status "tr(1) failed"

mdconfig -d -u ${UNIT} 1> /dev/null 2> /dev/null
__status "mdconfig(8) failed (destroy)"

mkisofs -J -R -b ${FLOPPY} -o bios.iso ${FLOPPY} 1> /dev/null 2> /dev/null
__status "mkisofs(1) failed"


Put all BIOS related stuff (flashing program/BIOS itself) into bios directory in the same place as this script is, lets call it create_bios_iso.sh, the listing will look like that:
Code:
# find .
./bios
./bios/flash.exe
./bios/bios.img
./create_bios_iso.sh


... and after usage:
Code:
# find .
./FDSTD.288
./bios.iso
./bios
./bios/flash.exe
./bios/bios.img
./create_bios_iso.sh
__________________
religions, worst damnation of mankind
"If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds

Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”.
vermaden's: links resources deviantart spreadbsd
Reply With Quote
  #3   (View Single Post)  
Old 11th March 2010
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Tcpdump Spy
 
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243
Default

Using a bootable FreeDOS USB drive works better IMO, you can add/remove stuff as needed.
I made mine with GRUB4DOS, grub4dos is not just "grub for dos" but also adds many features (Unfortunately, documentation is even worse than grub!).
Previously I also used SysLinux for the same task.
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #4   (View Single Post)  
Old 11th March 2010
vermaden's Avatar
vermaden vermaden is offline
Administrator
 
Join Date: Apr 2008
Location: pl_PL.lodz
Posts: 1,056
Default

Yes but I havent found any decent howto on that topic (bootable dos on pendrive), I started to search for syslinux sollution since memstick images are created with that, You have any links on taht topic?
__________________
religions, worst damnation of mankind
"If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds

Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”.
vermaden's: links resources deviantart spreadbsd
Reply With Quote
  #5   (View Single Post)  
Old 11th March 2010
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Tcpdump Spy
 
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243
Default

The "official" Syslinux docs do a pretty good job on that IMO.

It's very simple, just run the syslinux command (IIRC it's in FreeBSD ports), then adjust the syslinux.cfg startup file, which is also very simple ... Just read the Docs ...
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #6   (View Single Post)  
Old 11th March 2010
vermaden's Avatar
vermaden vermaden is offline
Administrator
 
Join Date: Apr 2008
Location: pl_PL.lodz
Posts: 1,056
Default

Ok, thanks, I will do that
__________________
religions, worst damnation of mankind
"If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds

Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”.
vermaden's: links resources deviantart spreadbsd
Reply With Quote
  #7   (View Single Post)  
Old 14th March 2010
FBSD FBSD is offline
Real Name: Joe Barbish
KING
 
Join Date: Feb 2010
Location: Angeles City, Philippines
Posts: 19
Default

I don’t think you really booted the cd your scripts create. The floppy.image is booted and is on the cd as a file named floppy.image, but the flash and new bios img files are not there. And for such a simple process you go and post scripts with out any explanations of what the scripts are doing. The reader has to be expert in writing scripts to even start understand what is happening. This sure is not a how to in my book

As sysadmin I all ways login as root.
1. copy your msdos.floppy.img to root. In my case the floppy image contains the basic programs to fix any fat32 drive, IE. [fdisk, format, more, scandisk, edit, chkdsk, find, command.com, sys.com, io.sys, msdos.sys].
2. Download from your BIOS vendor the program to flash the bios and the new.bios.img file. Put them in root.
3. Make a memory disk of the msdos.floppy.img

Code:
  mdconfig -f msdos.floppy.img
  mount -t msdosfs /dev/md0 /mnt
  cd /mnt
  ls


Now you see all the files in the floppy.image. To this you have to add the 2 files from the vendor used to update your motherboard BIOS chip

Code:
 cp flash.exe  /mnt/
 cp new.bios.img /mnt
 ls


Now you will see your BIOS update files added to the floppy image
Now back out

Code:
  cd /root
  umount /mnt
  mdconfig -d -u md0
Now your ready to create the cd.iso file. You will need the mkisofs command. It's not part of the base system so you have to install it from the ports system or package system.

Code:
 pkg_add -r cdrtools
 rehash
 mkisofs -J -R -b msdos.floppy.img -o cd.iso msdos.floppy.img


Now your ready to burn the cd.iso file to CDROM. The burncd program is part of the base system. If your using a cd/rw cd and it all ready has stuff on it then blank it out.

Code:
 burncd -v -f /dev/acd0 -s4 -e blank fixate


Ready to burn your bootable floppy iso to cd

Code:
burncd -v -f /dev/acd0 -s4 -e data /root/cd.iso fixate


Booting from this newly created CD will put you at the MSDOS command line as drive A: To display the contents of drive A: issue

Code:
dir


Then key in the program to update the system BIOS chip

Code:
Flash


When completed, remove the CD from the CD/RW drive and reboot the PC.
If your PC doesn’t boot then you know you have very big problem. The BIOS update you just ran didn’t work or the update.bios.img file was not the correct one for your bios chip. Your only remaining option is to buy a new motherboard from a know vendor who provides technical support for their equipment.
Attached Files
File Type: zip msdos.floppy.img.zip (690.1 KB, 223 views)
__________________
FreeBSD Install Guide www.a1poweruser.com
Reply With Quote
  #8   (View Single Post)  
Old 14th March 2010
vermaden's Avatar
vermaden vermaden is offline
Administrator
 
Join Date: Apr 2008
Location: pl_PL.lodz
Posts: 1,056
Default

Quote:
Originally Posted by FBSD View Post
[COLOR=black][FONT=Verdana]I don’t think you really booted the cd your scripts create. The floppy.image is booted and is on the cd as a file named floppy.image, but the flash and new bios img files are not there.
... I did booted int (on Dell e6400 laptop for example, flash.exe and bios.bin were on the same floppy image, not on CD itself (this it why I use 2.88 MB floppy instead of 1.44 MB one).

Quote:
And for such a simple process you go and post scripts with out any explanations of what the scripts are doing.
... and my fault is that someone do not know what is happening? Please.
man ANY_COMMAND will tell him everything.

Quote:
The reader has to be expert in writing scripts to even start understand what is happening. This sure is not a how to in my book
It shows how to simply create bootable ISO image and update BIOS, if You are not able to burn ISO image to CD in the operating system that you use, you definitely should not update BIOS ... PERIOD.

Someone just can take this script and use it, even without understanding it.

Quote:
As sysadmin I all ways login as root.
... and You run X11 on root also?

Quote:
(YOUR EXPLANATIONS)
All of them are exacly the same as mine, so whats the point?
__________________
religions, worst damnation of mankind
"If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds

Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”.
vermaden's: links resources deviantart spreadbsd
Reply With Quote
Reply

Tags
bios, flash, mkisofs, update, upgrade

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot update with CVS guitarscn OpenBSD Installation and Upgrading 3 7th September 2009 11:12 PM
Flashing BIOS from freebsd mc_i2020 FreeBSD General 7 28th July 2008 10:11 PM
Update from 6.1 to 6.3 did nothing? alanthing FreeBSD Installation and Upgrading 4 8th June 2008 02:28 PM
A couple of errors, which I believe are associated with the BIOS Johnny2Bad FreeBSD Installation and Upgrading 1 15th May 2008 03:58 AM


All times are GMT. The time now is 10:22 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick