[syslinux] syslinux installation issues
Bernd Blaauw
bblaauw at home.nl
Wed Nov 11 10:35:48 PST 2009
Op 11-11-2009 9:04, H. Peter Anvin schreef:
> almost-completely-undocumented disk locking API again, and I think I got
> something working that works both in DOS mode and in Windows mode, at
> least on WinME (which is what I have working in a VM at the moment.)
>
> I pushed it out as syslinux-3.84-pre1 together with HDT 0.3.5.
>
> -hpa
>
I'm afraid I haven't got terribly good news. My initial testing was on
FreeDOS, but to be sure to make my testing more valid against your own,
I went back to a Win98 (Second Edition) bootdisk, with msdos 7.10 on it,
supporting fat32 etc.
msdos 7.10 , C: (fat32) exists, not formatted: "sector read error" (not
even hitting 'read error..abort/retry/fail')
msdos 7.10, C: (fat32) exists, formatted by FORMAT C: (not FORMAT C: /S
so no system files transferred): sector read error
msdos 7.10, C: (fat16) exists, not formatted: "sector read error"
msdos 7.10, C: (fat16) exists, formatted by FORMAT C: --> WORKS
(silently, no visual feedback on succes or failure except DIR /AH C:\*.*
to show hidden C:\LDLINUX.SYS)
I'm not sure if VMware changed anything in their Workstation virtual
machines or that the syslinux.com (DOS) program doesn't understand fat32
somehow on harddisk partitions.
a simple batchfile could contain something like this perhaps (only
virtual machines, don't wreck any real hardware environments please)
@echo off
if exist c:\nul goto next
a:\fdisk
goto end
:next
rem Show current operating system kernel version, command interpreter,
run Syslinux as it errors out safely anyway on unformatted partitions
rem and it's hard to determine if C: is formatted or not (except maybe
by first trying to write to it to some temp file)
ver /r
a:\syslinux c:
if errorlevel 1 echo Something went wrong with installing Syslinux to
C:, perhaps you need to run A:\FORMAT C: first (or encountered a bug).
goto end
:end
Dos\Syslinux.c contains the following which is already above my
sourcecode understanding level, I'm afraid:
void read_device(int drive, const void *buf, size_t nsecs, unsigned int
sector)
{
uint8_t err;
uint16_t errnum;
struct diskio dio;
dprintf("read_device(%d,%p,%u,%u)\n", drive, buf, nsecs, sector);
dio.startsector = sector;
dio.sectors = nsecs;
dio.bufoffs = (uintptr_t) buf;
dio.bufseg = data_segment();
if (dos_version >= 0x0710) {
asm volatile("int $0x21 ; setc %0"
: "=bcdm" (err), "=a" (errnum)
: "a" (0x7305), "b" (&dio), "c" (-1), "d" (drive),
"S" (0), "m" (dio));
} else {
asm volatile("int $0x25 ; setc %0 ; popfw"
: "=bcdm" (err), "=a" (errnum)
: "a" (drive-1), "b" (&dio), "c" (-1), "d" (buf),
"m" (dio)
: "esi");
}
if (err) {
dprintf("rv = %04x\n", errnum);
die("sector read error");
}
}
More information about the Syslinux
mailing list