FDOS / kernel

FreeDOS kernel - implements the core MS-DOS/PC-DOS (R) compatible operating system. It is derived from Pat Villani's DOS-C kernel and released under the GPL v2 or later. Please see http://www.freedos.org/ for more details about the FreeDOS (TM) Project.
http://kernel.fdos.org/
GNU General Public License v2.0
811 stars 144 forks source link

initdisk.c extend check for chs.Sector == 0 to chs.Head == 0 #116

Closed boeckmann closed 11 months ago

boeckmann commented 11 months ago

On Gitlab there was a lengthy discussion on an issue that eventually was identified as layer 8 error. But the person had one point in that he/she mentioned that the check at

https://github.com/FDOS/kernel/blob/8c8d21311974e3274b3c03306f3113ee77ff2f45/kernel/initdisk.c#L735

should probably be extended to check for an invalid head value of zero, which could otherwise lead to a division by zero. I think this is true and should probably be changed. The question is if a "default" head value of 254 should be assumed or if the drive should be rejected at all.

The discussion took place at https://gitlab.com/FreeDOS/base/kernel/-/issues/4

boeckmann commented 11 months ago

Implemented by commit f1249dc.