Jim Fridlund
2008-Oct-25 20:22 UTC
[syslinux] Linux syslinux-3.72 does not update boot block for SD devices
Hi all. I am new to the list. I am trying to make a SD flash bootable. I have a MSI Wind netbook running Fedora 9 with a built-in card reader that detects the SD flash properly. However, when I run syslinux, it does not update the boot block. I also tried using a SD -> USB adapter, but I get the same behavior. Fedora 9 uses an older syslinux 3.61, but I also tried the latest 3.72 with no luck. NOTE: I downloaded the Windows 3.72 version of syslinux and I was able to successfully create a bootable SD flash under Windows XP. Here are the details: Multi-card reader scsi 4:0:0:0: Direct-Access Generic- Multi-Card 1.00 PQ: 0 ANSI: 0 CCS sd 4:0:0:0: [sdb] Attached SCSI removable disk sd 4:0:0:0: Attached scsi generic sg1 type 0 SanDisk 1G micro SD with SD adapter sd 4:0:0:0: [sdb] 1984000 512-byte hardware sectors (1016 MB) sd 4:0:0:0: [sdb] Write Protect is off sd 4:0:0:0: [sdb] Mode Sense: 03 00 00 00 sd 4:0:0:0: [sdb] Assuming drive cache: write through sd 4:0:0:0: [sdb] 1984000 512-byte hardware sectors (1016 MB) sd 4:0:0:0: [sdb] Write Protect is off sd 4:0:0:0: [sdb] Mode Sense: 03 00 00 00 sd 4:0:0:0: [sdb] Assuming drive cache: write through sdb: sdb1 $ fdisk -l /dev/sdb Disk /dev/sdb: 1015 MB, 1015808000 bytes 32 heads, 61 sectors/track, 1016 cylinders Units = cylinders of 1952 * 512 = 999424 bytes Disk identifier: 0x3ab5b3b6 Device Boot Start End Blocks Id System /dev/sdb1 * 1 1016 991585+ b W95 FAT32 Dump of MBR: Device: /dev/sdb 0x000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... 0x1B0: 00 00 00 00 00 00 00 00 B6 B3 B5 3A 00 00 80 01 0x1C0: 01 00 0B 1F FD F7 3D 00 00 00 C3 42 1E 00 00 00 0x1D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 AA I tried running the following: syslinux /dev/sdb1 syslinux -s /dev/sdb1 syslinux -sf /dev/sdb1 The ldlinux.sys gets created, but it does not update the MBR. I am able to make a bootable USB thumbdrive just by running 'syslinux /dev/ sdb1' and I was expecting the same behavior on the SD flash. If I run the command from Windows, it does update the MBR. I ran: syslinux -m -a e: The MBR changed and the SD flash is now bootable. Device: /dev/sdb 0x000: FA 31 C0 8E D8 8E D0 BC 00 7C 89 E6 06 57 52 8E 0x010: C0 FB FC BF 00 06 B9 00 01 F3 A5 EA 20 06 00 00 0x020: 52 B4 41 BB AA 55 31 C9 30 F6 F9 CD 13 72 13 81 0x030: FB 55 AA 75 0D D1 E9 73 09 66 C7 06 8D 06 B4 42 0x040: EB 15 5A B4 08 CD 13 83 E1 3F 51 0F B6 C6 40 F7 0x050: E1 52 50 66 31 C0 66 99 E8 66 00 E8 21 01 4D 69 0x060: 73 73 69 6E 67 20 6F 70 65 72 61 74 69 6E 67 20 0x070: 73 79 73 74 65 6D 2E 0D 0A 66 60 66 31 D2 BB 00 0x080: 7C 66 52 66 50 06 53 6A 01 6A 10 89 E6 66 F7 36 0x090: F4 7B C0 E4 06 88 E1 88 C5 92 F6 36 F8 7B 88 C6 0x0A0: 08 E1 41 B8 01 02 8A 16 FA 7B CD 13 8D 64 10 66 0x0B0: 61 C3 E8 C4 FF BE BE 7D BF BE 07 B9 20 00 F3 A5 0x0C0: C3 66 60 89 E5 BB BE 07 B9 04 00 31 C0 53 51 F6 0x0D0: 07 80 74 03 40 89 DE 83 C3 10 E2 F3 48 74 5B 79 0x0E0: 39 59 5B 8A 47 04 3C 0F 74 06 24 7F 3C 05 75 22 0x0F0: 66 8B 47 08 66 8B 56 14 66 01 D0 66 21 D2 75 03 0x100: 66 89 C2 E8 AC FF 72 03 E8 B6 FF 66 8B 46 1C E8 0x110: A0 FF 83 C3 10 E2 CC 66 61 C3 E8 62 00 4D 75 6C 0x120: 74 69 70 6C 65 20 61 63 74 69 76 65 20 70 61 72 0x130: 74 69 74 69 6F 6E 73 2E 0D 0A 66 8B 44 08 66 03 0x140: 46 1C 66 89 44 08 E8 30 FF 72 13 81 3E FE 7D 55 0x150: AA 0F 85 06 FF BC FA 7B 5A 5F 07 FA FF E4 E8 1E 0x160: 00 4F 70 65 72 61 74 69 6E 67 20 73 79 73 74 65 0x170: 6D 20 6C 6F 61 64 20 65 72 72 6F 72 2E 0D 0A 5E 0x180: AC B4 0E 8A 3E 62 04 B3 07 CD 10 3C 0A 75 F1 CD 0x190: 18 F4 EB FD 00 00 00 00 00 00 00 00 00 00 00 00 0x1A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1B0: 00 00 00 00 00 00 00 00 B6 B3 B5 3A 00 00 80 01 0x1C0: 01 00 0B 1F FD F7 3D 00 00 00 C3 42 1E 00 00 00 0x1D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 AA Is there another step I need to do to get syslinux under linux to work? Any help greatly appreciated. Thanks in advance. -- Jim
H. Peter Anvin
2008-Oct-25 21:12 UTC
[syslinux] Linux syslinux-3.72 does not update boot block for SD devices
Jim Fridlund wrote:> > The ldlinux.sys gets created, but it does not update the MBR. I am > able to make a bootable USB thumbdrive just by running 'syslinux /dev/ > sdb1' and I was expecting the same behavior on the SD flash. > > If I run the command from Windows, it does update the MBR. I ran: > > syslinux -m -a e: > > The MBR changed and the SD flash is now bootable. > > Is there another step I need to do to get syslinux under linux to > work? Any help greatly appreciated. Thanks in advance.dd if=/usr/lib/syslinux/mbr.bin of=/dev/sdb bs=440 count=1 The reason this isn't automatic is that this is sometimes not possible under Linux. -hpa
Jim Fridlund
2008-Oct-26 02:20 UTC
[syslinux] Linux syslinux-3.72 does not update boot block for SD devices
On Oct 25, 2008, at 4:40 PM, H. Peter Anvin wrote:> Jim Fridlund wrote: >> I see what you mean. I stepped through it with the debugger and I see >> syslinux trying to write to the mbr by invoking xpwrite() function >> which calls the pwrite() system call. The system call returned 512 >> bytes, but reading back still showed the old values. Again, thanks >> for >> the help! > > What you saw was writing the boot sector, not the MBR. > > -hpaYes, thanks for clarifying and for all your help. syslinux rocks! :) -- Jim