Теперь самое важное:
как поделить загрузочный образ на части? Опущу подробности поисков, перейду к сути. Ответ даёт фрагмент из Википедии:
The module structure requires more explanation: OS-9 keeps a "module directory", a memory-resident list of all modules that are in memory either by having been loaded, or by having been found in ROM during an initial scan at boot time. When one types a command to the OS-9 shell, it will look first in the current module directory for a module of the specified name and will use it (and increase its link count) if found, or it will look on disk for an appropriately named file if not. In OS-9/6809 and OS-9/68000, the module directory is flat, but OS-9000 made the module directory tree-structured.
То есть OS-9 имеет модульную структуру, и во время загрузки ОС сканирует бинарный образ и ищет в нём модули. Ищет, очевидно, по заголовкам. Подробности о модулях находим тут:
OS-9 System Overview:
https://colorcomputerarchive.com/repo/D ... oware).pdf (стр. 44)
Там же расписана структура заголовка и его полей, но это старый документ, он подходит не вполне. Более актуальную и подробную информацию можно взять в руководстве от версии 4.7:
https://lms.ee.hm.edu/~seck/AlleDateien ... k_tech.pdf (стр. 17)
Код: Выделить всё
typedef struct mh_com {
u_int16 m_sync, /* sync bytes */
m_sysrev; /* system revision check value */
u_int32 m_size; /* module size */
owner_id m_owner; /* group/user ID */
u_int32 m_name; /* offset to module name */
u_int16 m_access, /* access permissions */
m_tylan, /* module type and language */
m_attrev, /* module attributes and revision /*
m_edit; /* module edition number */
u_int32 m_needs, /* module hardware requirements flags */
/* (reserved) */
m_share, /* offset of shared data in statics */
m_symbol, /* offset to symbol table */
m_exec, /* offset to execution entry point */
m_excpt, /* offset to exception entry point*/
m_data, /* data storage requirement */
m_stack, /* stack size */
m_idata, /* offset to initialized data */
m_idref, /* offset to data reference lists */
m_init, /* offset to initialization routine*/
m_term, /* offset to termination routine */
m_dbias, /* data area pointer bias*/
m_cbias; /* code area pointer bias */
u_int16 m_ident; /* linkage locale identifier */
char m_spare[8]; /* reserved */
u_int16 m_parity; /* header parity */
} mh_com, *Mh_com;
и так далее по тексту
Заголовок исследуемой системы имеет
длину 0x58 байт (сразу за ним начинается имя модуля), магическое число
(sync bytes) -
0x0591. Собственно, в самом начале файла мы их и обнаруживаем. Создав в IDA Pro соответствующие
structs и
enums и попробовав применить их к образу, выясняем, что
он состоит из модулей OS-9, просто-напросто состыкованных один за другим.
Программой для разбора бинарника на модули займусь позже.
Другие полезные ссылки:
https://lms.ee.hm.edu/~seck/AlleDateien/ - установочный диск OS-9 x86 v4.7, вся документация к ней и прочие полезности. Более полного и свежего сборника в Интернете не обнаружено.
http://www.bitsavers.org/pdf/gimix/Gimi ... _Jan83.pdf
https://www.roug.org/soren/6809/os9sysprog.html - OS-9 Operating System System Programmer's Manual от очень ранних версий