Date: Fri, 06 Apr 2001 14:13:30 -0700 (PDT) From: John Baldwin <jhb@FreeBSD.org> To: Doug Ambrisko <ambrisko@whistle.com> Cc: freebsd-hackers@FreeBSD.org, dhw@whistle.com, mark@whistle.com Subject: Re: Fix for CDROM boot for IBM PC desktops Message-ID: <XFMail.010406141330.jhb@FreeBSD.org> In-Reply-To: <200104061948.MAA75143@whistle.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 06-Apr-01 Doug Ambrisko wrote: > John Baldwin writes: >| On 06-Apr-01 Doug Ambrisko wrote: >| > On on IBM PC desktops a FreeBSD bootable CDROM won't boot and it hangs. >| > This has been reported in several places. >| > >| > The problem is that some BIOSes namely IBM's writes to the boot sector >| > of the floppy to potentially update the parameters for the emulated >| > floppy used for the El Torrito boot. Since we do not allocate space >| > for a typical MSDOS "Boot Sector" when the BIOS updates this area >| > it then ends up modifying the boot code which is not a good thing. >| > The boot code then fails in random ways. I also did a work-around >| > for linking the address of "xread" into boot2.c. >| > >| > The fix is in PR i386/26382: >| > http://www.freebsd.org/cgi/query-pr.cgi?pr=26382 >| > This would be great to get into 4.3 but probably won't make it. >| >| Ewwww, gross. :) Bad BIOS, no cookie. I don't think the perl script is >| needed, simple a one time adjustment of the xread offset in boot2.c should >| be >| enough. These programs change very rarely > > I also have an update to the patch to make it work on IBM ThinkPads so > that we can boot a FreeBSD CD on a ThinkPad. The problem on the ThinkPad > is that it reads the values from the defined MSDOS boot sector and > uses them to figure out how to do the emulation. Which in our cause > is random code values. Since the BIOS didn't see the media type defined > as a floppy it made it a IDE device somewhere (such as ad11). This > confused the 3rd stage loader. > > Here is the updated structure in boot1.s: > /* From OpenBSD biosboot.S with tuned values from Doug Ambrisko so > ThinkPads can boot from CDROM. I think the critical part > is setting the media type. > */ > .org 0x03, 0x00 > .asciz "FreeBSD" > /* BPB */ > .org 0x0b, 0x00 > bpb: .word 512 /* sector size */ > .byte 1 /* sectors/cluster */ > .word 1 /* reserved sectors */ > .byte 2 /* # of FAT */ > .word 224 /* root entries */ > .word 2880 /* small sectors */ > .byte 0xf0 /* media type (fd) */ > .word 144 /* sectors/fat */ > .word 18 /* sectors per track */ > .word 2 /* # of heads */ > > /* EBPB */ > .org 0x1c, 0x00 > ebpb: .long 16 /* hidden sectors */ > .long 0 /* large sectors */ > > Mark, wanted me to clarify the the BIOS is only changing stuff in > the emulated image and not the media itself. Understood. You can't write to a CD-ROM. :) > I think something needs to be done for the linking because it is > really frustrating when stuff changes and there are no warnings > or hints why things just all of a sudden break when a simple change > is made. Either that or huge warnings saying: > > /* "xread" is a hardcoded value in boot2.c, if you change > the layout in boot1.s figure out what the new value is > and then update it in boot2.c */ > > I like computers to think for me so I don't have to. I tend to > make more mistakes then they do! Well, think of boot1 as a really small device driver and xread as a syscall. The offset is a magic number. > Thanks for looking at it, any idea on what needs to be done to get this > commited? I'm currently testing my final patch for ThinkPads but > it takes a while to burn a FreeBSD release CD on a slow 2X burner. > > Obviously it would make our lives easier if we can just load things > on the IBM hardware we have around here and reduce traffic on -questions! The maintainer for this stuff is Robert Nordier (rnordier@) and he'll need to sign off on it. Any chance you could figuratively kick the head of whoever at IBM did this up around their ears for assuming all the world is DOS? :) > Doug A. -- John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.010406141330.jhb>