| Summary: | [libi386] [patch] BTX Loader i386 incorrectly probes EDD, possibly resulting division by zero | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | Arrigo Marchiori <ardovm> | ||||||||
| Component: | kern | Assignee: | freebsd-bugs (Nobody) <bugs> | ||||||||
| Status: | Closed FIXED | ||||||||||
| Severity: | Affects Only Me | CC: | imp, jhb | ||||||||
| Priority: | Normal | Keywords: | patch | ||||||||
| Version: | Unspecified | ||||||||||
| Hardware: | Any | ||||||||||
| OS: | Any | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Arrigo Marchiori
2013-03-08 13:40:01 UTC
Hello, this patch still applies to today's 9-STABLE. Can I do anything to help integrating it? Regards, -- rigo http://rigo.altervista.org Created attachment 144581 [details]
ignore_zero_size.patch
This patch is not correct. The '48h' function is always required if EDD is present and is part of the 'Fixed Disk Access' subset as defined in EDD 3.0.
The part of the parameter block conditional on the 'EDD' subset returned by '48h' is the DPTE pointer (edd_params_seg and edd_params_off in 'struct edd_params'). The boot code does not use that. In addition, while there is a flag in the 'flags' field (bit 2) that determines if the geometry returned in 'struct edd_params' is correct, that flag only covers the 'cylinders', 'heads', and 'sectors_per_track'. The BIOS is always required to populate 'sectors' and 'sector_size' with valid values.
Instead, it seems your BIOS is just broken, but that can be worked around by ignoring sector counts of 0.
Hello, after some investigation, I could confirm that yes, the BIOS is broken. However, the vendor of the embedded PC's I am using, is still applying the old and broken BIOS to recent units. I only upgraded the FreeBSD sources last week, and the patch seems not to be effective any more, when booting from (recent) USB pen drives. For some weird reasons, the sector size of such USB sticks is returned as 12022 bytes or something like that, that is not correct. Would it be advisable to add some more safety checks, such as: - sectors must be non-zero; - sector_size must be non-zero; - sector_size must be a multiple of 512? Such a check enables my terminals to boot again. Created attachment 162919 [details]
Add consistency checks to EDD information
The EDD information is only used, if the sector count and sector size respect very simple requisites.
For bugs matching the following conditions: - Status == In Progress - Assignee == "bugs@FreeBSD.org" - Last Modified Year <= 2017 Do - Set Status to "Open" Different fallback code is in place now. Closing. |