| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Fix misplaced #endif which made it impossible to build without DEBUG.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
|
|
| |
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
|
|
| |
Seems to be most appropriate...
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
|
|
|
|
| |
Based on commit: ad4cf1470977f648ee1dd45e97939589ccb0393c
(might need address adjustments)
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
|
|
|
|
|
|
| |
Conflicts:
com32/Makefile
com32/modules/chain.c
Note: add ReactOS' stuff introduced in old chain.c
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
| |
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
|
|
| |
It will not skip updates on EBRs with empty logical partition.
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
| |
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
| |
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
| |
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
| |
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
| |
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
|
|
|
|
| |
- split into 'fixchs' and 'hide' (cleaner, easier to read)
- fix hide related conditions (they were too strong)
- make sure we test for iterator status as well
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
| |
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- make sure opt.maps implies opt.sect, and simplify
conditions throughout the files
- move structure opt -> options.c
- adjust #includes
- omitted values in seg= and sect= are assumed 0
in all cases now
- mangler_handover(): eax for gpt handover set only for
iterated disks
- rename parse_args() -> opt_parse_args()
- rename mangler_common() -> mangler_init()
- add opt_set_defs()
- if mmapped sector would conflict with the file, turn
off mmapping instead of bailing out
- update temporary chain.txt to reflect changes + other
fixups
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
|
|
|
|
|
|
| |
Conflicts:
com32/modules/chain.c
Changes to DRMK imported into commented-out section
of com32/chain/mangle.c
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
|
|
|
| |
When the handover area is being prepared, most primitive case
should be checked first (not-iterated disk, including typeraw).
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
|
|
|
| |
All chain related code no longer depends on hardcoded sector
size.
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
|
|
|
|
|
|
|
| |
- lbacnt field in disklib's diskinfo allows for more strict sanity
checks
- hardcoded SECTOR is no longer used - we use diskinfo's bps value now
- pi_begin() does additional sanity checks on header values, and allows
using secondary gpt partition list, if crc of the primary one is
invalid
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
|
|
|
|
|
|
|
| |
All functions related to partition entries' mangling has been moved
to mangle.c, including appropriate renames:
pentry_mangle() -> manglepe_mbrchshide()
pem_setchs() -> mpe_setchs()
pem_sethide() -> mpe_sethide()
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch introduces small feature, allowing so called "service-only"
runs - where the chain modules does everything as instructed, but
otherwise doesn't perform actual chainloading.
This is useful for 'mbrchs', '[un]hide[all]' and 'setbpb'+'save'
options, making possible adjustments to partition/boot sector values on
any disk/partition.
See 'chain' option in doc/chain.txt for more details.
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
| |
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
|
|
|
| |
With disklib update providing total sectors info, make raw handover
use it (instead of forcing arbitrary number).
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
|
|
|
| |
It could be useful to be able to simply unhide partitions. This short
patch adds such functionality.
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
|
|
|
|
|
|
|
| |
pentry_mangle() has been simplified and made more readable, using
non-selfkilling iterators, introduced recently.
Further plan is to move 'mbrchs' into separate module (fixit.c32)
providing such feature for all disks (along with some other features,
including [un]hide[all]).
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds 3 modes of operation to lba2chs:
l2c_cnul - strict cylinder mode, using at most the value returned by
13h/48h or 13h/08h
l2c_cadd - allow using 1 cylinder more. Only if cylinders are less than
1024 and total drive's lba size is not on a cylinder boundary.
l2c_max - allow using any cylinder number.
Modes have effect only if CHS geometry (cbios) is valid. chain.c uses
l2c_cadd.
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
| |
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch changes iterator behaviour to not free themselves
automatically after finished iteration or error. This allows
us to be able to always:
- check their status through ->status field
- access last valid data
It will allow simplification of pentry_mangle() function in
further commits.
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
| |
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
|
|
|
|
|
| |
This adds a possibility to create an area resembling proper handover,
when booting mbr of some media. If we have custom/special booting code
always expecting handover, this would allow us to boot it from the 1st
sector as well.
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
|
|
|
|
| |
This tiny patch adjusts how lba2chs() deals with unknown geometries.
Instead of returning max values of "typical" geometries, it returns
chs values calculated from them.
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Bugs:
- one introduced ages ago - find_by_* functions should be tested vs. <0
for failure
- one introduced by 579f15c7c456c - it accidentally blocked too much
when testing for ',' in drive/partition option parsing
- one introduced by d4d713c9ccfe0 - sone machines / VMs seem to set
@40:75 just 1, regardless of amount of fixed disks available
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Generic function detecting BPB type (7 versions) have been added.
set{hid,geo,drv} have been replaced by single setbpb option, using
mentioned function to make more precise decisions what to update where.
Full BSS and BS emulation has been added, also employing BPB detection.
Some logic/flow changes in chain's main(). There was also a bug, in
which backup sector was populated with wrong data.
Appropriate documentation updates.
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
|
|
|
|
|
|
| |
Previously, option 'save' has been executed as a part of bpb mangling.
This was rather inflexible.
Apart from that, all mangle functions test their respective opt.* options
internally.
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
|
|
|
|
|
|
|
| |
- seg='s offset values default to 0 if ommited
- sect='s offset values default to 0x7c00 if ommited
- FDOS's bootsector loaded at 0x1fe0
- drive / partition parsing: bugfix, so lables with ',' are recognized
properly
- big documentation update
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
|
|
|
|
|
|
|
| |
It seems that chs values in extended partitions are expected to provide
absolute positions. Previously these values were calculated directly
from ebr lba values.
Partiter now provides cebr_lba and ebr_lba that hold absolute values
of current and next ebr.
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- small bugfix in partiter.c
- new options: hideall, mbrchs
- new partiter feature - rawindex - counts all (inc. empty) partitions in all
cases
hideall is expansion of hide, that hides all partitions in a chain, not
only primary ones
mbrchs walks over all partitions and fixes chs values in mbr entries
rawindex keeps count of all partitions, including holes in EBRs
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
|
|
|
|
|
| |
- add 'bss=' option
- update usage()
- ommited offsets in 'file=' and 'sect=' default to 0x7c00 now
- cosmetics
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
|
|
|
|
|
|
|
|
| |
In certain situations (new features to be added later), it's useful
to be able to step through all partitions in a partition list. This
patch adds necessary functionality.
Adjust chain.c to use new version of partiter.
Also small bugfixes and comment changes.
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
new file: chain.h
new file: common.h
new file: mangle.c
new file: mangle.h
new file: options.c
new file: options.h
new file: utility.c
new file: utility.h
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
| |
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
|
|
|
| |
Option 'setdrv' can autodetect offset now. setbpb4 is removed, as it's
no longer necessary.
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The logic behind file/sect/hand area handling is more flexible
now. Furthermore, a user can explicitly control where ds:si/ds:bp
should point during chainloading.
Other misc. changes:
- registry setup is more conservative
- 'if' style
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
|
|
|
| |
There's no need to have separate 'sect' and 'segs='. 'segf' alias of
'seg' can also be removed now.
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
|
|
|
| |
Renamed some of the options to better fit the whole scheme.
Also adjusted usage().
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
| |
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
|
|
|
|
|
|
| |
Previously, chain module always set ds:si and ds:bp to handover
area (unless otherwise blocked). This is not necessarily valid in case
when both file and sector are being loaded - here file should receive
pointer to it's [relocated] sector, and it's unlikely interested in
mbr-like handover area at all.
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
|
|
|
|
|
|
| |
- update usage()
- add chs2lba()
- update handover code to generate CHS values
- make sure 'write' is never default
- add wait_key()
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds following options:
- setgeo (bpb: set legacy geometry)
- setdrv (bpb: set physical drive number)
- read (read mbr / bs - previously always attempted)
- write (write bs - for bpb mangling)
- filebpb (also mangle 'kernel' file in memory)
- msdos7 (dos7+ IP is set as required by io.sys)
Signed-off-by: Michal Soltys <soltys@ziu.info>
|
|
|
|
|
|
|
|
|
|
|
| |
'[no]hand' allows explicit control whenever to create handover data
'[no]smap' allows loading bootsector without mapping it during
actual chainloading (meant for upcoming BPB mangling options)
Expanded handover code moved mostly to its own function
Signed-off-by: Michal Soltys <soltys@ziu.info>
|