mirror of
https://github.com/reactos/reactos.git
synced 2025-01-03 21:09:19 +00:00
[INSTALL_FREELDR]
Instead of keeping binary C arrays for FAT bootsectors (that by the way were completely out of date and were broken) in header files, just generate them out of our ASM-compiled bootsectors, with bin2c (as we do for PCI data for the HAL) and use them instead! So now we can use installfreeldr.exe to install e.g. a correct bootsector on a USB key that will work for loading freeldr! (and thus get rid of the Syslinux hack I presented in my video). svn path=/trunk/; revision=66012
This commit is contained in:
parent
87a268ef23
commit
057211e26a
4 changed files with 24 additions and 105 deletions
|
@ -1,35 +0,0 @@
|
|||
unsigned char fat_data[] = {
|
||||
|
||||
0xeb, 0x3c, 0x90, 0x46, 0x72, 0x4c, 0x64, 0x72, 0x31, 0x2e, 0x30, 0x00, 0x02, 0x01, 0x01, 0x00,
|
||||
0x02, 0xe0, 0x00, 0x40, 0x0b, 0xf0, 0x09, 0x00, 0x12, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x29, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x4f, 0x20, 0x4e, 0x41,
|
||||
0x4d, 0x45, 0x20, 0x20, 0x20, 0x20, 0x46, 0x41, 0x54, 0x31, 0x32, 0x20, 0x20, 0x20, 0x31, 0xc0,
|
||||
0x8e, 0xd0, 0xbd, 0x00, 0x7c, 0xbc, 0xf2, 0x7b, 0x8e, 0xd8, 0x8e, 0xc0, 0x80, 0x7e, 0x24, 0xff,
|
||||
0x75, 0x03, 0x88, 0x56, 0x24, 0xb4, 0x08, 0x8a, 0x56, 0x24, 0xcd, 0x13, 0x73, 0x05, 0xb9, 0xff,
|
||||
0xff, 0x88, 0xce, 0x88, 0xeb, 0x88, 0xcf, 0xc0, 0xef, 0x06, 0x80, 0xe1, 0x3f, 0x66, 0x0f, 0xb6,
|
||||
0xc6, 0x66, 0x0f, 0xb7, 0xdb, 0x66, 0x0f, 0xb6, 0xc9, 0x66, 0x40, 0x66, 0x43, 0x66, 0xf7, 0xe1,
|
||||
0x66, 0xf7, 0xe3, 0x66, 0x89, 0x46, 0xf8, 0x31, 0xc0, 0x31, 0xc9, 0x8a, 0x46, 0x10, 0xf7, 0x66,
|
||||
0x16, 0x03, 0x46, 0x1c, 0x13, 0x56, 0x1e, 0x03, 0x46, 0x0e, 0x11, 0xca, 0x89, 0x46, 0xfc, 0x89,
|
||||
0x56, 0xfe, 0x8b, 0x76, 0x11, 0x60, 0x31, 0xd2, 0xb8, 0x20, 0x00, 0xf7, 0xe6, 0x8b, 0x5e, 0x0b,
|
||||
0x01, 0xd8, 0x48, 0xf7, 0xf3, 0x01, 0x46, 0xfc, 0x11, 0x4e, 0xfe, 0x61, 0xbb, 0xe0, 0x07, 0x8e,
|
||||
0xc3, 0x31, 0xdb, 0x31, 0xc9, 0x41, 0x31, 0xff, 0x06, 0xe8, 0x78, 0x00, 0x07, 0x26, 0x38, 0x2d,
|
||||
0x74, 0x38, 0x60, 0xb1, 0x0b, 0xbe, 0xef, 0x7d, 0xf3, 0xa6, 0x61, 0x74, 0x0e, 0x4e, 0x74, 0x2a,
|
||||
0x83, 0xc7, 0x20, 0x81, 0xff, 0x00, 0x02, 0x72, 0xe4, 0xeb, 0xd1, 0x26, 0x8b, 0x45, 0x1a, 0x50,
|
||||
0x68, 0x00, 0x08, 0x07, 0xe8, 0x3c, 0x00, 0x58, 0xc7, 0x46, 0xf6, 0x44, 0x7d, 0xc7, 0x46, 0xf4,
|
||||
0x33, 0x7d, 0xc7, 0x46, 0xf2, 0x1c, 0x7d, 0xe9, 0xf9, 0x02, 0xbe, 0xc7, 0x7d, 0xe8, 0x0c, 0x00,
|
||||
0xbe, 0xdf, 0x7d, 0xe8, 0x06, 0x00, 0x31, 0xc0, 0xcd, 0x16, 0xcd, 0x19, 0xac, 0x08, 0xc0, 0x74,
|
||||
0x09, 0xb4, 0x0e, 0xbb, 0x07, 0x00, 0xcd, 0x10, 0xeb, 0xf2, 0xc3, 0xbe, 0xba, 0x7d, 0xe8, 0xeb,
|
||||
0xff, 0xeb, 0xdd, 0x48, 0x48, 0x30, 0xed, 0x8a, 0x4e, 0x0d, 0xf7, 0xe1, 0x03, 0x46, 0xfc, 0x13,
|
||||
0x56, 0xfe, 0x31, 0xdb, 0x60, 0x49, 0x01, 0xc8, 0x83, 0xd2, 0x00, 0x3b, 0x56, 0xfa, 0x77, 0x07,
|
||||
0x72, 0x31, 0x3b, 0x46, 0xf8, 0x76, 0x2c, 0x61, 0x60, 0x66, 0x6a, 0x00, 0x52, 0x50, 0x06, 0x53,
|
||||
0x6a, 0x01, 0x6a, 0x10, 0x89, 0xe6, 0x8a, 0x56, 0x24, 0xb4, 0x42, 0xcd, 0x13, 0x72, 0xbc, 0x83,
|
||||
0xc4, 0x10, 0x61, 0x40, 0x83, 0xd2, 0x00, 0x53, 0x8c, 0xc3, 0x83, 0xc3, 0x20, 0x8e, 0xc3, 0x5b,
|
||||
0xe2, 0xd6, 0xc3, 0x61, 0x60, 0x91, 0x92, 0x31, 0xd2, 0xf7, 0x76, 0x18, 0x91, 0xf7, 0x76, 0x18,
|
||||
0x42, 0x87, 0xca, 0xf7, 0x76, 0x1a, 0x88, 0xd6, 0x8a, 0x56, 0x24, 0x88, 0xc5, 0xc0, 0xcc, 0x02,
|
||||
0x08, 0xe1, 0xb8, 0x01, 0x02, 0xcd, 0x13, 0x72, 0x82, 0x61, 0x40, 0x75, 0x01, 0x42, 0x53, 0x8c,
|
||||
0xc3, 0x83, 0xc3, 0x20, 0x8e, 0xc3, 0x5b, 0xe2, 0xcb, 0xc3, 0x44, 0x69, 0x73, 0x6b, 0x20, 0x65,
|
||||
0x72, 0x72, 0x6f, 0x72, 0x0d, 0x0a, 0x00, 0x66, 0x72, 0x65, 0x65, 0x6c, 0x64, 0x72, 0x2e, 0x73,
|
||||
0x79, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x0d, 0x0a, 0x00, 0x50,
|
||||
0x72, 0x65, 0x73, 0x73, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6b, 0x65, 0x79, 0x0d, 0x0a, 0x00, 0x46,
|
||||
0x52, 0x45, 0x45, 0x4c, 0x44, 0x52, 0x20, 0x53, 0x59, 0x53, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa
|
||||
};
|
|
@ -1,67 +0,0 @@
|
|||
unsigned char fat32_data[] = {
|
||||
|
||||
0xeb, 0x58, 0x90, 0x46, 0x72, 0x4c, 0x64, 0x72, 0x31, 0x2e, 0x30, 0x00, 0x02, 0x00, 0x20, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x4f, 0x20, 0x4e, 0x41, 0x4d, 0x45, 0x20, 0x20,
|
||||
0x20, 0x20, 0x46, 0x41, 0x54, 0x33, 0x32, 0x20, 0x20, 0x20, 0x31, 0xc0, 0x8e, 0xd8, 0x8e, 0xc0,
|
||||
0x8e, 0xd0, 0xbd, 0x00, 0x7c, 0xbc, 0x00, 0x7c, 0x80, 0x7e, 0x40, 0xff, 0x75, 0x03, 0x88, 0x56,
|
||||
0x40, 0x83, 0x7e, 0x16, 0x00, 0x75, 0x0d, 0x66, 0x83, 0x7e, 0x11, 0x00, 0x75, 0x06, 0x83, 0x7e,
|
||||
0x2a, 0x00, 0x76, 0x03, 0xe9, 0xff, 0x00, 0xb8, 0x00, 0x08, 0x8a, 0x56, 0x40, 0xcd, 0x13, 0x73,
|
||||
0x05, 0xb9, 0xff, 0xff, 0x88, 0xce, 0x88, 0xeb, 0x88, 0xcf, 0xc0, 0xef, 0x06, 0x80, 0xe1, 0x3f,
|
||||
0x66, 0x0f, 0xb6, 0xc6, 0x66, 0x0f, 0xb7, 0xdb, 0x66, 0x0f, 0xb6, 0xc9, 0x66, 0x40, 0x66, 0x43,
|
||||
0x66, 0xf7, 0xe1, 0x66, 0xf7, 0xe3, 0x66, 0xa3, 0xa7, 0x7d, 0x66, 0xb8, 0x0e, 0x00, 0x00, 0x00,
|
||||
0x66, 0x03, 0x46, 0x1c, 0xb9, 0x01, 0x00, 0x31, 0xdb, 0x8e, 0xc3, 0xbb, 0x00, 0x7e, 0xe8, 0x03,
|
||||
0x00, 0xe9, 0x2c, 0x01, 0x66, 0x3b, 0x06, 0xa7, 0x7d, 0x73, 0x1b, 0x66, 0x60, 0xb4, 0x41, 0xbb,
|
||||
0xaa, 0x55, 0x8a, 0x56, 0x40, 0xcd, 0x13, 0x72, 0x55, 0x81, 0xfb, 0x55, 0xaa, 0x75, 0x4f, 0xf6,
|
||||
0xc1, 0x01, 0x74, 0x4a, 0x66, 0x61, 0x66, 0x60, 0x81, 0xf9, 0x40, 0x00, 0x76, 0x03, 0xb9, 0x40,
|
||||
0x00, 0x89, 0x0e, 0x3a, 0x7d, 0x66, 0x6a, 0x00, 0x66, 0x50, 0x06, 0x53, 0x51, 0x6a, 0x10, 0x89,
|
||||
0xe6, 0x8a, 0x56, 0x40, 0xb4, 0x42, 0xcd, 0x13, 0x72, 0x63, 0x83, 0xc4, 0x10, 0x66, 0x61, 0x53,
|
||||
0x66, 0x8b, 0x1e, 0x3a, 0x7d, 0x66, 0x01, 0xd8, 0x66, 0xc1, 0xe3, 0x05, 0x8c, 0xc2, 0x01, 0xda,
|
||||
0x8e, 0xc2, 0x5b, 0x2b, 0x0e, 0x3a, 0x7d, 0x75, 0xbd, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x66, 0x61,
|
||||
0x66, 0x60, 0x66, 0x31, 0xd2, 0x66, 0x0f, 0xb7, 0x4e, 0x18, 0x66, 0xf7, 0xf1, 0xfe, 0xc2, 0x88,
|
||||
0xd1, 0x66, 0x89, 0xc2, 0x66, 0xc1, 0xea, 0x10, 0xf7, 0x76, 0x1a, 0x88, 0xd6, 0x8a, 0x56, 0x40,
|
||||
0x88, 0xc5, 0xd0, 0xcc, 0xd0, 0xcc, 0x08, 0xe1, 0xb8, 0x01, 0x02, 0xcd, 0x13, 0x72, 0x0e, 0x66,
|
||||
0x61, 0x66, 0x40, 0x8c, 0xc2, 0x83, 0xc2, 0x20, 0x8e, 0xc2, 0xe2, 0xc4, 0xc3, 0xbe, 0xab, 0x7d,
|
||||
0xe8, 0x15, 0x00, 0xe9, 0x06, 0x00, 0xbe, 0xb8, 0x7d, 0xe8, 0x0c, 0x00, 0xbe, 0xcc, 0x7d, 0xe8,
|
||||
0x06, 0x00, 0x31, 0xc0, 0xcd, 0x16, 0xcd, 0x19, 0xac, 0x08, 0xc0, 0x74, 0x09, 0xb4, 0x0e, 0xbb,
|
||||
0x07, 0x00, 0xcd, 0x10, 0xeb, 0xf2, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x44, 0x69, 0x73, 0x6b, 0x20,
|
||||
0x65, 0x72, 0x72, 0x6f, 0x72, 0x0d, 0x0a, 0x00, 0x46, 0x69, 0x6c, 0x65, 0x20, 0x73, 0x79, 0x73,
|
||||
0x74, 0x65, 0x6d, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x0d, 0x0a, 0x00, 0x50, 0x72, 0x65, 0x73,
|
||||
0x73, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6b, 0x65, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x65, 0x73,
|
||||
0x74, 0x61, 0x72, 0x74, 0x0d, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa,
|
||||
0x66, 0x8b, 0x46, 0x2c, 0x66, 0x3d, 0xf8, 0xff, 0xff, 0x0f, 0x72, 0x03, 0xe9, 0x67, 0x01, 0xbb,
|
||||
0x00, 0x20, 0x8e, 0xc3, 0xe8, 0x27, 0x01, 0x31, 0xdb, 0x8a, 0x5e, 0x0d, 0xc1, 0xe3, 0x04, 0xb8,
|
||||
0x00, 0x20, 0x8e, 0xc0, 0x31, 0xff, 0xbe, 0x9d, 0x7f, 0xb9, 0x0b, 0x00, 0xf3, 0xa6, 0x74, 0x2a,
|
||||
0x4b, 0x75, 0x03, 0xe9, 0x40, 0x01, 0x8c, 0xc0, 0x05, 0x02, 0x00, 0x8e, 0xc0, 0x31, 0xff, 0xbe,
|
||||
0x9d, 0x7f, 0xb9, 0x0b, 0x00, 0xf3, 0xa6, 0x74, 0x11, 0x4b, 0x75, 0xea, 0x66, 0x8b, 0x46, 0x2c,
|
||||
0xe8, 0x6f, 0x00, 0x66, 0x89, 0x46, 0x2c, 0xe9, 0xa6, 0xff, 0xbe, 0xa8, 0x7f, 0xe8, 0x38, 0xff,
|
||||
0x31, 0xff, 0x31, 0xd2, 0x26, 0x8b, 0x45, 0x14, 0x66, 0xc1, 0xe0, 0x10, 0x26, 0x8b, 0x45, 0x1a,
|
||||
0x66, 0x3d, 0x02, 0x00, 0x00, 0x00, 0x73, 0x03, 0xe9, 0x0b, 0xff, 0x66, 0x3d, 0xf8, 0xff, 0xff,
|
||||
0x0f, 0x72, 0x03, 0xe9, 0x00, 0xff, 0xbb, 0x00, 0x08, 0x8e, 0xc3, 0x66, 0x3d, 0xf8, 0xff, 0xff,
|
||||
0x0f, 0x73, 0x21, 0x66, 0x50, 0x31, 0xdb, 0x06, 0xe8, 0xa3, 0x00, 0x07, 0x31, 0xdb, 0x8a, 0x5e,
|
||||
0x0d, 0xc1, 0xe3, 0x05, 0x8c, 0xc0, 0x01, 0xd8, 0x8e, 0xc0, 0x66, 0x58, 0x06, 0xe8, 0x12, 0x00,
|
||||
0x07, 0xe9, 0xd7, 0xff, 0x8a, 0x56, 0x40, 0x8a, 0x36, 0xfd, 0x7d, 0x31, 0xc0, 0x50, 0x68, 0x00,
|
||||
0x80, 0xcb, 0x66, 0xc1, 0xe0, 0x02, 0x66, 0x89, 0xc1, 0x66, 0x31, 0xd2, 0x66, 0x0f, 0xb7, 0x5e,
|
||||
0x0b, 0x66, 0x53, 0x66, 0xf7, 0xf3, 0x66, 0x0f, 0xb7, 0x5e, 0x0e, 0x66, 0x01, 0xd8, 0x66, 0x8b,
|
||||
0x5e, 0x1c, 0x66, 0x01, 0xd8, 0x66, 0x5b, 0x66, 0x4b, 0x66, 0x21, 0xd9, 0x66, 0x0f, 0xb7, 0x5e,
|
||||
0x28, 0x81, 0xe3, 0x0f, 0x00, 0x74, 0x16, 0x3a, 0x5e, 0x10, 0x72, 0x03, 0xe9, 0x87, 0xfe, 0x66,
|
||||
0x50, 0x66, 0x8b, 0x46, 0x24, 0x66, 0xf7, 0xe3, 0x66, 0x5a, 0x66, 0x01, 0xd0, 0x66, 0x51, 0x66,
|
||||
0x3b, 0x06, 0x3a, 0x7f, 0x74, 0x11, 0x66, 0xa3, 0x3a, 0x7f, 0xbb, 0x00, 0x70, 0x8e, 0xc3, 0x31,
|
||||
0xdb, 0xb9, 0x01, 0x00, 0xe8, 0xad, 0xfd, 0xbb, 0x00, 0x70, 0x8e, 0xc3, 0x66, 0x59, 0x26, 0x66,
|
||||
0x67, 0x8b, 0x01, 0x66, 0x25, 0xff, 0xff, 0xff, 0x0f, 0xc3, 0xff, 0xff, 0xff, 0xff, 0x66, 0x48,
|
||||
0x66, 0x48, 0x66, 0x31, 0xd2, 0x66, 0x0f, 0xb6, 0x5e, 0x0d, 0x66, 0xf7, 0xe3, 0x66, 0x50, 0x66,
|
||||
0x31, 0xd2, 0x66, 0x0f, 0xb6, 0x46, 0x10, 0x66, 0xf7, 0x66, 0x24, 0x66, 0x0f, 0xb7, 0x5e, 0x0e,
|
||||
0x66, 0x01, 0xd8, 0x66, 0x03, 0x46, 0x1c, 0x66, 0x5b, 0x66, 0x01, 0xd8, 0x31, 0xdb, 0x0f, 0xb6,
|
||||
0x4e, 0x0d, 0xe8, 0x5f, 0xfd, 0xc3, 0xbe, 0x85, 0x7f, 0xe8, 0x1c, 0xfe, 0xbe, 0xcc, 0x7d, 0xe8,
|
||||
0x16, 0xfe, 0xe9, 0x07, 0xfe, 0x66, 0x72, 0x65, 0x65, 0x6c, 0x64, 0x72, 0x2e, 0x73, 0x79, 0x73,
|
||||
0x20, 0x6e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x0d, 0x0a, 0x00, 0x46, 0x52, 0x45,
|
||||
0x45, 0x4c, 0x44, 0x52, 0x20, 0x53, 0x59, 0x53, 0x4c, 0x6f, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x20,
|
||||
0x46, 0x72, 0x65, 0x65, 0x4c, 0x6f, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x2e, 0x2e, 0x0d, 0x0a, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa
|
||||
};
|
|
@ -1,7 +1,23 @@
|
|||
|
||||
#####################################
|
||||
# Generate the FAT bootsector source files
|
||||
#
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/fat.c ${CMAKE_CURRENT_BINARY_DIR}/fat.h
|
||||
COMMAND native-bin2c ${CMAKE_CURRENT_BINARY_DIR}/../bootsect/fat.bin ${CMAKE_CURRENT_BINARY_DIR}/fat.c ${CMAKE_CURRENT_BINARY_DIR}/fat.h fat_data
|
||||
DEPENDS native-bin2c fat)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/fat32.c ${CMAKE_CURRENT_BINARY_DIR}/fat32.h
|
||||
COMMAND native-bin2c ${CMAKE_CURRENT_BINARY_DIR}/../bootsect/fat32.bin ${CMAKE_CURRENT_BINARY_DIR}/fat32.c ${CMAKE_CURRENT_BINARY_DIR}/fat32.h fat32_data
|
||||
DEPENDS native-bin2c fat32)
|
||||
#####################################
|
||||
|
||||
add_executable(installfreeldr EXCLUDE_FROM_ALL
|
||||
install.c
|
||||
volume.c)
|
||||
volume.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/fat.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/fat32.c)
|
||||
|
||||
set_module_type(installfreeldr win32cui)
|
||||
add_importlibs(installfreeldr msvcrt kernel32)
|
||||
|
|
|
@ -23,8 +23,13 @@
|
|||
#include <stdio.h>
|
||||
#include "install.h"
|
||||
#include "volume.h"
|
||||
#include "../bootsect/fat.h"
|
||||
#include "../bootsect/fat32.h"
|
||||
|
||||
/*
|
||||
* These includes are required to define
|
||||
* the fat_data and fat32_data arrays.
|
||||
*/
|
||||
#include "fat.h"
|
||||
#include "fat32.h"
|
||||
|
||||
BOOL BackupBootSector(LPCTSTR lpszVolumeName);
|
||||
BOOL InstallBootSector(LPCTSTR lpszVolumeType);
|
||||
|
|
Loading…
Reference in a new issue