According to the Advanced RISC Computing Specification v1.2, for partitions,
StartingAddress and EndingAddress are the start and end positions of the
partition in terms of byte offsets from the start of the disk.
CurrentAddress is the current offset into (i.e. relative to) the partition.
Fix also the FAT filesystem in accordance.
- FIXME fix: Retrieve the size of the disk in number of sectors in DiskOpen().
- Add extra validity checks in the DiskSeek() functions.
- Explicitly call PcDisk* functions in machpc.c and pcdisk.c, and
XboxDisk* functions in machxbox.c (the code in these files is not
called cross-platform).
CORE-16216 CORE-16248
- Modify DiskReportError() to use an internal "display counter", so that
imbricated DiskReportError(FALSE) ... DiskReportError(TRUE) can behave
as expected.
- Merge LoadAndBootDrive(), LoadAndBootPartition(),
LoadAndBootBootSector() into one LoadAndBootDevice() function + its
helpers (in progress...).
- "FrldrBootPath" -> "FrLdrBootPath";
- Get rid of GetFreeLoaderVersionString() and use FrLdrVersionString
directly instead;
- Rephrase some comments;
- Use RTL_NUMBER_OF();
- Reduce indent level in LoadOperatingSystem() and EditOperatingSystemEntry().
Bug fix:
- Fix DissectArcPath() for "ramdisk(0)" case.
- Move DiskStopFloppyMotor() calls into the implementations of
Boot(New)LinuxKernel() and Reboot() HW functions, and the explanation
comments in ChainLoadBiosBootSectorCode().
- Remove unneeded DiskStopFloppyMotor() dummies in ARM and PPC code.
- Use more adequate bitmask value to be sent to floppy's Digital Output
Register for shutting down its motor (based on OSDev & our floppy
controller driver).
- Add optional arguments BootDrive and BootPartition to
ChainLoadBiosBootSectorCode() so as not to modify explicitly the
FrldrBootDrive and FrldrBootPartition variables, that should remain
purely internal.
- Implement ChainLoadBiosBootSectorCode() for x64.
- Get rid of the machine-specific DiskGetBootPath(), and instead do its
job only once in the machine-specific InitializeBootDevices() (or in
MachInit() for PPC).
Cache the result of this operation into the globally-accessible
FrldrBootPath buffer. This avoids the unneeded calls to (Mach)DiskGetBootPath()
we used to do before.
Also remove the separate distinction between the PC and XBOX versions
of this functionality.
- Move the PC-specific DiskIsDriveRemovable() and DiskGetBootPath()
as well as the disk-IO-error functionality, back into the
corresponding PC-arch files.
- Simplify IniFileInitialize(), getting rid of IniOpenIniFile().
CORE-9023
FIXES:
======
- Fix parsing of the multiboot options string.
NOTE: They are not yet treated in a case-insensitive manner!
- Fix a bug in ArcOpen() so that it correctly skips the first path
separator (after the adapter-controller-peripheral ARC descriptors).
The path separator can be either a backslash or a slash (both are
allowed according to the specs); they were also already handled
correctly in other parts of the code.
- Fix DissectArcPath() so as to:
* **OPTIONALLY** (and not mandatorily!) return the path part that follows
the ARC adapter-controller-peripheral elements in the ARC path;
* make it correctly handle the (yes, optional!!) partition() part in the
ARC path, for the multi(x)disk(y)rdisk(z) cases.
ENHANCEMENTS:
=============
- Directly retrieve the default OS entry as we enumerate them and
build their list (i.e. merge the GetDefaultOperatingSystem() helper
within InitOperatingSystemList()).
- Directly use the opened 'FreeLoader' INI section via its ID in the
different functions that need it.
- Make the custom-boot and linux loaders honour the boot options they are
supposed to support (see FREELDR.INI documentation / template).
This includes the 'BootDrive' and 'BootPartition' (alternatively the ARC
'BootPath').
This also allows them to take into account the user-specified choices in the
FreeLdr custom-boot editors.
- Modify the FreeLdr custom-boot editors so as to correctly honour
the priorities of the boot options as specified in the FREELDR.INI
documentation / template.
- Use stack trick (union of structs) to reduce stack usage in the
FreeLdr custom-boot editors, because there are strings buffers that are
used in an alternate manner.
- Extract out from the editors the LoadOperatingSystem() calls, and
move it back into OptionMenuCustomBoot(), so that when this latter
function is called there is no risk of having a stack almost full.
- When building the ARC-compatible argument vector for the loaders, add
the mandatory "SystemPartition" path. This allows the loaders to NOT
call the machine-specific MachDiskGetBootPath() later on (this data is
indeed passed to them by the boot manager part of FreeLdr).
- Improve the FsOpenFile() helper so as to make it:
* return an adequate ARC_STATUS instead of a mere uninformative BOOLEAN;
* take open options, as well as a default path (optional) that would be
prepended to the file name in case the latter is a relative one.
- Make RamDiskLoadVirtualFile() return an actual descriptive ARC_STATUS
value, and make it take an optional default path (same usage as the one
in FsOpenFile() ).
+ Remove useless NTAPI .
- UiInitialize() and TuiTextToColor(), TuiTextToFillStyle(): load or
convert named settings into corresponding values using setting table and
a tight for-loop, instead of duplicating 10x the same parameter reading
logic.
- UiInitialize(): Open the "Display" INI section just once. Remove usage
of DisplayModeText[] buffer.
- UiShowMessageBoxesInSection() and UiShowMessageBoxesInArgv(): reduce
code indentation level.
ENHANCEMENTS for NT OS loader:
==============================
- Don't use MachDiskGetBootPath() but use instead the "SystemPartition"
value passed via the ARC argument vector by the boot manager
(+ validation checks). Use it as the "default path" when calling
FsOpenFile() or loading the ramdisk.
- Honour the FreeLdr-specific "Hal=" and "Kernel=" options by converting
them into NT standard "/HAL=" and "/KERNEL=" options in the boot
command line.
Note that if the latter ones are already present on the standard "Options="
option line, they would take precedence over those passed via the separate
"Hal=" and "Kernel=" FreeLdr-specific options.
Also add some documentation links to Geoff Chappell's website about
how the default HAL and KERNEL names are chosen depending on the
detected underlying platform on which the NT OS loader is running.
This fixes null pointer call bug, which was revealed in 85d44fc. Spotted by Mark Jansen. CORE-16216
Co-authored-by: Mark Jansen <mark.jansen@reactos.org>
Rename RosAudioSrv to AudioSrv in audio service itself and in all system components which are related to this, same as it done in Win2k3.
It allows MS DxDiag to detect the system audio service correctly, so it becomes possible to run DirectSound test properly with MS dsound.dll, although it works with some minor errors and only in older VirtualBox versions, ~ up to 5.1.38 (and in other emulators as well).
CORE-16307
- Create xbox.cmake based on legacy.cmake and pic.cmake
- Revive Xbox HAL files and add them to the build
- Fix boot with Xbox HAL, add missing parts from halinit_up.c
- Code style and debug logging improvements in pcibus.c
- Allow to choose Xbox HAL in usetup
CORE-16216
- Add some forgotten, or move some misplaced ArcClose() calls so as
to avoid leakages in failure paths. (Thanks to Serge Gautherie for
having caught some of them.)
- Simplify some code; remove unneeded casts; use string-safe functions.
- Factor out disk & partition opening in LoadAndBootPartition() and
LoadAndBootDrive() into a LoadAndBootPartitionOrDrive() helper.
- Use ARC paths and ArcOpen()/ArcRead() instead of calling the
machine-specific BIOS-oriented DiskGetPartitionEntry() and
MachDiskReadLogicalSectors() functions to open the disk/partition
and read their boot sectors.
- Don't forget to close the opened boot sector file in LoadAndBootBootSector().
- Add assertions for DiskReadBufferSize in PcMemFinalizeMemoryMap()
and EnumerateHarddisks().
- x86/amd64 only:
* Add a DisableA20 helper for disabling the A20 line, before rebooting
back, or chain-load a boot sector, into 16-bit world.
Also pulse the output port of the keyboard controller to clear out
its state after having set the state of the A20 line.
* In addition to disabling the A20 line when rebooting or chain-loading
a boot sector, reset the video back to 80x25 text mode.
- Reset the cursor position back to the origin when initializing or
terminating the TUI.
- Get rid of the FsCloseFile(), FsReadFile(), FsGetFileInformation(),
FsGetFileSize() and FsSetFilePointer() wrappers and use the ARC
functions directly instead. Make FsOpenFile() return an ARC file
descriptor ID of the correct type. Get rid of unused FS_* defines.
- Use TRACEs in the ***Mount() filesystem functions for diagnostics
purposes.
- Remove a leak in FatGetFatEntry(). Assign stuff via QuadPart where
possible in FatMount(). Remove an unused member in FAT_FILE_INFO.
- Reduce code indentation in BtrFsMount() and remove a leak there.
- Disable reading the "BootPath" parameter in the linux loader since
we don't use this parameter (yet??)
- EditBox: Display the initial contents of the text buffer.
This allows modifying already existing text in the passed buffer.
- Menu:
* Make both MenuHeader and MenuFooter optional (but the latter is
more "optional" than the former...).
* Allow passing a user-provided "Context" structure to the key-press
filter callback, and pass also the index of the menu item that has
been selected.
- Minor formatting fixes.