📄 dospartlibata.c
字号:
| Partition Entry number 04 | Partition Entry offset 0x1be| +-----------------------------+-----------------------------+ | Status field = 0x80 | Primary (bootable) Partition| +-----------------------------+-----------------------------+ | Type 0x01: MSDOS Partition 12-bit FAT | +-----------------------------------------------------------+ | Partition start LCHS: Cylinder 0000, Head 001, Sector 01 | +-----------------------------------------------------------+ | Partition end LCHS: Cylinder 0005, Head 063, Sector 63 | +-----------------------------------------------------------+ | Sectors offset from MBR partition 0x0000003f | +-----------------------------------------------------------+ | Number of sectors in partition 0x00005e41 | +-----------------------------------------------------------+ | Sectors offset from start of disk 0x0000003f | +-----------------------------------------------------------+ +--------------------------------------+ | Master Boot Record - Partition Table | +--------------------------------------+----------+ | Current LCHS Cylinder 0000, Head 000, Sector 00 | +-----------------------------+-------------------+---------+ | Partition Entry number 03 | Partition Entry offset 0x1ce| +-----------------------------+-----------------------------+ | Status field = 0x00 | Non-bootable Partition | +-----------------------------+-----------------------------+ | Type 0x05: MSDOS Extended Partition | +-----------------------------------------------------------+ | Partition start LCHS: Cylinder 0006, Head 000, Sector 01 | +-----------------------------------------------------------+ | Partition end LCHS: Cylinder 0014, Head 063, Sector 63 | +-----------------------------------------------------------+ | Sectors offset from MBR partition 0x00005e80 | +-----------------------------------------------------------+ | Number of sectors in partition 0x00200dc0 | +-----------------------------------------------------------+ | Sectors offset from start of disk 0x00005e80 | +-----------------------------------------------------------+ +--------------------------------------+ | Master Boot Record - Partition Table | +--------------------------------------+----------+ | Current LCHS Cylinder 0000, Head 000, Sector 00 | +-----------------------------+-------------------+---------+ | Partition Entry number 02 | Partition Entry offset 0x1de| +-----------------------------+-----------------------------+ | Status field = 0x00 | Non-bootable Partition | +-----------------------------+-----------------------------+ | Type 0x00: Empty (NULL) Partition | +-----------------------------------------------------------+ ....(REST of OUTPUT DELETED FOR SPACE)..... There is going to be a lot more output than above. The above is simply an example of the format. dosPartShowAta will display all four partition table entries for each partition sector. For example, a disk with 4 logical drives (C,D,E, & F) will contain 5 partition sectors and dosPartShowAta() will display 20 partition table entries. Utilities such as Norton Utilities DISKEDIT (TM) do not automaticly display extended partition data. This must be done manually. That is not a restriction with dosPartShowAta. dosPartShowAta will automatically display all extended partitions.------------------------------------------------------------------------------ ***********************************************************3.) EXAMPLE OF MOUNTING DISK CONTAINING BOTH VXWORKS LONG FILE NAME FILE SYSTEMS AND MSDOS 8.3 FILE NAME FILE SYSTEMS. *********************************************************** This code may be used to provide support for mounting disks simultaneously containing both VxWorks style "long names" (not MSDOS compatible) file systems and standard 8.3 MSDOS compatible file systems. This is useful since the pc386 and pc486 boot loader (VxLD 1.2) will only boot from a 8.3 file system. One could use FDISK.exe to create a small (10MB) primary partition for booting. Then create a larger extended partition. Then, using this code to find the offset to the large extended partition, one would overlay a block device over the extended partition and format the extended partition with a long filename file system. This will allow pc486/pc486 boot from the 8.3 file name style 10MB partition and do data storage on the long-filename partition. VxWorks long filename file systems are incompatible with MSDOS however. Here are the steps that work for me manually: (starting with a clean hard disk)A.) Use FDISK.exe to create a 10MB primary boot partition. (Or however big you want the 8.3 boot partition to be)B.) Use FDISK.exe to create a extended partition for the rest of the disk. (or however big you want it to be)C.) Use FDISK.exe to place a logical drive (or many) within the extended partition. We will use this for the long filename file system.D.) Format the 10MB with MSDOS with "format c: /s /u /c" command. Leave the extended partition unformatted.E.) Boot VxWorks and load dosPartLibAta.oF.) View the partition data created in steps A-C: For Example: -> sp dosPartShowAta,0,0 task spawned: id = 1fb47b0, name = u0 value = 33245104 = 0x1fb47b0 -> On my system this produces the following output: +--------------------------------------+ | Master Boot Record - Partition Table | +--------------------------------------+----------+ | Current LCHS Cylinder 0000, Head 000, Sector 00 | +-----------------------------+-------------------+---------+ | Partition Entry number 04 | Partition Entry offset 0x1be| +-----------------------------+-----------------------------+ | Status field = 0x80 | Primary (bootable) Partition| +-----------------------------+-----------------------------+ | Type 0x01: MSDOS Partition 12-bit FAT | +-----------------------------------------------------------+ | Partition start LCHS: Cylinder 0000, Head 001, Sector 01 | +-----------------------------------------------------------+ | Partition end LCHS: Cylinder 0005, Head 063, Sector 63 | +-----------------------------------------------------------+ | Sectors offset from MBR partition 0x0000003f | +-----------------------------------------------------------+ | Number of sectors in partition 0x00005e41 | +-----------------------------------------------------------+ | Sectors offset from start of disk 0x0000003f | +-----------------------------------------------------------+ +--------------------------------------+ | Master Boot Record - Partition Table | +--------------------------------------+----------+ | Current LCHS Cylinder 0000, Head 000, Sector 00 | +-----------------------------+-------------------+---------+ | Partition Entry number 03 | Partition Entry offset 0x1ce| +-----------------------------+-----------------------------+ | Status field = 0x00 | Non-bootable Partition | +-----------------------------+-----------------------------+ | Type 0x05: MSDOS Extended Partition | +-----------------------------------------------------------+ | Partition start LCHS: Cylinder 0006, Head 000, Sector 01 | +-----------------------------------------------------------+ | Partition end LCHS: Cylinder 0014, Head 063, Sector 63 | +-----------------------------------------------------------+ | Sectors offset from MBR partition 0x00005e80 | +-----------------------------------------------------------+ | Number of sectors in partition 0x00200dc0 | +-----------------------------------------------------------+ | Sectors offset from start of disk 0x00005e80 | +-----------------------------------------------------------+ ....(All Empty partition data deleted for space.)... +-----------------------------+ | Extended Partition Table 01 | +-----------------------------+-------------------+ | Current LCHS Cylinder 0006, Head 000, Sector 01 | +-----------------------------+-------------------+---------+ | Partition Entry number 04 | Partition Entry offset 0x1be| +-----------------------------+-----------------------------+ | Status field = 0x00 | Non-bootable Partition | +-----------------------------+-----------------------------+ | Type 0x06: MSDOS 16-bit FAT >=32M Partition | +-----------------------------------------------------------+ | Partition start LCHS: Cylinder 0006, Head 001, Sector 01 | +-----------------------------------------------------------+ | Partition end LCHS: Cylinder 0014, Head 063, Sector 63 | +-----------------------------------------------------------+ | Sectors offset from first extended partition 0x0000003f | +-----------------------------------------------------------+ | Number of sectors in partition 0x00200d81 | +-----------------------------------------------------------+ | Sectors offset from start of disk 0x00005ebf | +-----------------------------------------------------------+ ....(All Empty partition data deleted for space.)... Note the "Extended Partition Table 01" "Partition Entry number 04" values for "Number of sectors in partition 0x00200d81" and "Sectors offset from start of disk 0x00005ebf" (Values will vary for different disks, obviously)G.) Using these values, create a block device from the shell: -> pMyAtaBlkDev = ataDevCreate (0,0, 0x00200d81, 0x00005ebf) new symbol "pMyAtaBlkDev" added to symbol table. pMyAtaBlkDev = 0x36a860: value = 33245356 = 0x1fb48ac -> AKA: ptrAtaBlkDev = ataDevCreate (ctrl, drive, blkSize, blkOffset);H.) Using this block device, create a long filename file system upon it: (DOS_OPT_LONGNAMES == 0x4) -> dosFsMkfsOptionsSet (0x4) value = 0 = 0x0 -> dosFsMkfs ("/ataCtrl0Drive0Part1", pMyAtaBlkDev) value = 33245200 = 0x1fb4810 -> dosFsConfigShow "/ataCtrl0Drive0Part1" device name: /ataCtrl0Drive0Part1 total number of sectors: 2100609 bytes per sector: 512 media byte: 0xf0 # of sectors per cluster: 33 # of reserved sectors: 1 # of FAT tables: 2 # of sectors per FAT: 249 max # of root dir entries: 112 # of hidden sectors: 0 removable medium: TRUE disk change w/out warning: not enabled auto-sync mode: not enabled long file names: ENABLED exportable file system: not enabled lowercase-only filenames: not enabled volume mode: O_RDWR (read/write) available space: 1075244544 bytes max avail. contig space: 1075244544 bytes value = 0 = 0x0 -> I.) Reset parameters to use ata booting in config.h: For example: #define DEFAULT_BOOT_LINE \ "ata=0,0(0,0)eno:/ata0/vxWorks h=90.0.0.3 \ e=90.0.0.50:ff000000 u=johnx pw=cogsNcogs! tn=t90-50 o=fei" #define SYS_WARM_TYPE 2 (0=BIOS, 1=Floppy, 2=Ata (Hard)) #define SYS_WARM_ATA_CTRL 0 (0 = primary ctrl: 1= secondary ctrl) #define SYS_WARM_ATA_DRIVE 0 (0 = master :1 = slave) Remake your bootrom/bootrom_uncmp & vxWorks images.J.) Use vxsys.com to write the VxLD-1.2 boot sector loader to C: Note also: Contact WRS Customer Support for versions of vxsys/vxcopy utilities which function in MSDOS-OS. The versions shipped with tornado only work in Windows95/NT It is easier to use the MSDOS versions when making bootable hard disks. Window95 primary partitions must be unlocked with the internal MSDOS command "C:\> lock c:"K.) Use vxcopy to copy the bootrom image to the C: primary partition. L.) Use xcopy.exe to copy the vxWorks image to the root directory of the primary boot partition. Note that you will need to save the core file on the Tornado host and point the target server to it with the "-c" option when booting from an ATA disk when using the host tools.M.) Once you've booted VxWorks from the 10MB 8.3 partition you may use this routine to mount both the 8.3 file system in the primary boot partition and the long filenames (40chars) file system in the extended partition you created: -> sp dosPartMountAta,0,0 task spawned: id = 1fb47b0, name = u0 value = 33245104 = 0x1fb47b0 -> Mounting partition 00 - VxWorks device Name "/ataCtrl0Drive0Part0" Absolute sector: 0x0000003f Number of sectors: 0x00005e41 Mounting partition 01 - VxWorks device Name "/ataCtrl0Drive0Part1" Absolute sector: 0x00005ebf Number of sectors: 0x00200d81 -> dosFsConfigShow "/ataCtrl0Drive0Part0" device name: /ataCtrl0Drive0Part0 total number of sectors: 24129 bytes per sector: 512 media byte: 0xf8 # of sectors per cluster: 8 # of reserved sectors: 1 # of FAT tables: 2 # of sectors per FAT: 9 max # of root dir entries: 512 # of hidden sectors: 63 removable medium: TRUE disk change w/out warning: not enabled auto-sync mode: not enabled long file names: not enabled exportable file system: not enabled
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -