FDOS/kernel

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

Closed this issue · 1 comments

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

if (driveParam->chs.Sector == 0) {

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

Implemented by commit f1249dc.