Commit Graph

847 Commits

Author SHA1 Message Date
Hermès Bélusca-Maïto
bdf1b0ca5d [FREELDR:XBOX:PC98] Fix compilation dependencies and linking (#8512)
Addendum to commit 9e64fa837d (PR #8510)
CORE-16216, CORE-17977

pcmem.c: Surround more PC-specific routines in `!SARCH_XBOX || !SARCH_PC98`,
so that they aren't compiled for XBOX or PC98.

pcat.cmake: Inform that pcmem.c is used by pc98mem.c
2025-12-24 13:48:52 +01:00
Hermès Bélusca-Maïto
cf901f3b78 [FREELDR:XBOX] Fix GCC compilation (#8512)
CORE-16216

Addendum to commit 9e64fa837d (PR #8510)

Fixes GCC complaint when compiling for XBOX (or PC98)
```
boot/freeldr/freeldr/arch/i386/pc/machpc.c:1123:1: error: 'DetectKeyboardController' defined but not used [-Werror=unused-function]
DetectKeyboardController(PCONFIGURATION_COMPONENT_DATA BusKey)
^~~~~~~~~~~~~~~~~~~~~~~~
```
2025-12-24 13:48:11 +01:00
Erdem Ersoy
66018d5e84 [BOOTDATA] Update Turkish localization timezone (#8528)
CORE-20403
2025-12-24 13:46:26 +01:00
Mark Jansen
07904ea449 [BOOTDATA] Add missed files for the vmware video driver 2025-12-24 13:45:50 +01:00
Mark Jansen
dea54fb53a [BOOTDATA] update caroots.inf
CORE-20398
2025-12-24 13:43:53 +01:00
Stanislav Motylkov
7f64cd986b [FREELDR:PC98] Fix build by doing a partial revert
Partial revert of 9decadee83.
It introduced a typo in the assembler code that broke the build.
Also, "Press any key" text fits into 512 bootsector space on both GCC/MSVC.

CORE-19882 CORE-17977
2025-12-19 23:58:01 +01:00
Hermès Bélusca-Maïto
ea90485339 [FREELDR:XBOX/UEFI] No need for a specific ScrollUp routine, just call the VidFb one (#8509)
And use the console `CurrentAttr` for screen filling, instead of
hardcoding it to white-on-black.
2025-12-19 13:21:49 +01:00
Hermès Bélusca-Maïto
d1445c8e69 [FREELDR:XBOX/UEFI] Unify the XBOX and UEFI linear framebuffer support together (#8509)
CORE-11954, CORE-16216

Here only moving and adjusting existing code has been done.
In the future, this code will be expanded to support other bits-per-pixel
formats and pixel bitmasks, available in UEFI platforms, and be used to
handle bios-based PC VESA framebuffer.
2025-12-19 13:21:23 +01:00
Hermès Bélusca-Maïto
9e64fa837d [FREELDR:XBOX] Fix compilation dependencies and linking for the XBOX build (#8510)
CORE-16216

machpc.c:
- Surround more PC-specific routines in `#if !defined(SARCH_XBOX)`,
  so that they aren't compiled for XBOX.

- In particular since commit 246f2d29db (PR #8418), the PC-specific
  `DiskGetConfigType()` was compiled at the same time as the XBOX one.
  This is now fixed.

machxbox.c
- Add a dummy `ChainLoadBiosBootSectorCode()` to make freeldr exports working.

xboxdisk.c
- Minimal Disk I/O error support routines.
- Add a dummy `DiskResetController()`, invoked in pchw.c
- Add a dummy `DiskStopFloppyMotor()`, needed for entry.S/linux.S

miscboot.c
- Still compile `LoadAndBootSector()` (avoids lots of changes elsewhere),
  but display an error message if it's run, and directly return with an error.

pcat.cmake
- Remove unnecessary dependencies on pcdisk.c and pcvesa.c
2025-12-19 12:15:02 +01:00
Hermès Bélusca-Maïto
f7aa25044e [FREELDR:PC] pcvideo.c!PcVideoSetMode(): deduplicate VESA mode setting code (#8508)
Group VESA text/graphics modes setting together.
2025-12-18 16:40:44 +01:00
Hermès Bélusca-Maïto
b050a4544e [FREELDR:PC] Add a mechanism to retrieve the initial video mode on startup (#8506)
This allows FreeLoader to know which initial video mode it has been
started with (e.g. if chainloaded from another bootloader that has
set the display to something different from 80x25 text mode), and,
either update its internal state and use the video mode if supported,
or, fall back to a known supported video mode (80x25 text).
2025-12-18 16:36:05 +01:00
Hermès Bélusca-Maïto
e04838086a [FREELDR:PC] pcvideo.c: Move PcVideoVesaGetSVGAModeInformation() and PcVideoSetBiosVesaMode() at the top
Will be used in the next commit.
2025-12-18 16:35:55 +01:00
Hermès Bélusca-Maïto
617f3bddfa [FREELDR:PC] Cache the type of video card installed on the system (#8505)
Cache the type when initializing the video, instead of invoking every time
`PcVideoDetectVideoCard()`. Indeed, the video card is not going to change
magically at runtime by the user :D
2025-12-17 13:08:43 +01:00
Hermès Bélusca-Maïto
0ffed7fd1e [FREELDR:PC] pccons.c, pcvesa.c, pcvideo.c: Reformatting (#8504) 2025-12-17 13:04:58 +01:00
Hermès Bélusca-Maïto
fa5cf28166 [FREELDR] Add a vgafont.h header (#8498)
It contains the symbols & macros used for the embedded VGA font.

- Adjust users to use `const UCHAR*` instead of `PUCHAR` pointer;
- pc98video.c: Capture the current `FontPtr[Line]` into an `UCHAR`,
  so as to safely modify it.
2025-12-13 20:19:05 +01:00
Hermès Bélusca-Maïto
e700c2548b [FREELDR] Remove unused stuff in pccons.c and uefimem.c (#8498) 2025-12-13 19:50:59 +01:00
Hermès Bélusca-Maïto
19b9b0b995 [FREELDR:PC] pcvideo.c: Fix two regression bugs (#8498)
- `PcVideoDetectVideoCard()`: Fix the call to Int 10h AX=1A00h.
  A 23-year old regression from commit 425bbb1543 (r3782), introduced
  by a copy-pasta error when converting video code from ASM to C.

- `PcVideoSetMode80x50_80x43()`: Fix setting the 80x50 VGA text-mode,
  which _is_ based on the 80x25 text-mode BIOS 0x03, see e.g.
  c2f2b01b74/arch/x86/boot/video-vga.c
  A 18-year old regression from commit 1b3e649577 (r25751), where the
  correct mode 0x03 was replaced by a VGA graphics mode 0x12, whereas
  the intent in this commit was to only switch to mode 0x12 only in
  `PcVideoPrepareForReactOS()` -- this was because at that time, bootvid
  and hal didn't support changing the video mode to what they needed.
  This has been fixed since.
2025-12-13 19:50:58 +01:00
Hermès Bélusca-Maïto
c554298b8d [FREELDR] VideoSetDisplayMode(): Make DisplayMode a PCSTR parameter (#8498) 2025-12-13 19:50:57 +01:00
Hermès Bélusca-Maïto
e13839699a [FREELDR:PC98] Use RtlMoveMemory() when scrolling up text in video (#8498) 2025-12-13 19:50:56 +01:00
Eric Kohl
43bc040072 [FREELDR] Store docking station info in the registry 2025-11-16 00:17:32 +01:00
Hermès Bélusca-Maïto
fa92d95800 [FREELDR] Use the new volume size mechanism when loading a storage volume as a RamDisk (#8423)
CORE-14603

The differentiation between a regular file loaded as a RamDisk and a
storage device volume, is done by invoking `ArcGetFileInformation()`
and looking at the `Information.Type` value.
2025-11-12 18:41:08 +01:00
Hermès Bélusca-Maïto
0ac0eb251c [FREELDR] Add a mechanism to determine the actual size of a mounted storage filesystem volume (#8423)
CORE-14603

- Each filesystem exposes a `*GetVolumeSize()` routine that returns the
  volume size it claims it reports (this is based on data from FAT/NTFS
  BIOS Parameter Blocks, or EXTn/BTRFS superblocks, similarly to what
  their NT filesystem drivers do).

- Given a device ID corresponding to a mountable drive, a top-level
  `FsGetVolumeSize()` routine attempts to mount the corresponding filesystem.
  This may fail if the device is not a drive, or if the filesystem is
  not recognized. If it succeeds, then the per-filesytem `*GetVolumeSize()`
  is invoked and the corresponding volume size is returned.
2025-11-12 18:40:45 +01:00
Daniel Victor
9690555308 [FREELDR] Remove some messages to free some code space on amd64.S (#8439) 2025-11-11 22:19:30 +01:00
Daniel Victor
3964c936cb [FREELDR] Add the relocator caller on realmode code (#8439)
CORE-19882
2025-11-11 22:19:30 +01:00
Daniel Victor
16f9ad2f46 [FREELDR] Add/change necessary code for the relocation code (#8439)
CORE-19882
2025-11-11 22:19:30 +01:00
Daniel Victor
70119785be [FREELDR] Do some MSVC fixes (#8454)
Ensure using the correct data segment in the lgdt/lidt invocation.
Also simplify the MASM/ML vs. gas syntax by using `lXdtPrefix`.

Fixes x86 MSVC FreeLoader boot following commit 9decadee83.
2025-11-11 16:27:47 +01:00
Daniel Victor
9decadee83 [FREELDR] Adapt bootsectors and multiboot code for future base address change (#7785)
See also PRs #8439 and #7530.
CORE-19882
2025-11-08 20:40:01 +01:00
Dmitry Borisov
19df2e65ff [INF] Add support for the NEC Star Alpha C-bus bridge device (#8446)
This device is present in some PC-98 models without C-bus slots
and has a SubClass ID of 0x80 (other bridge) instead of 0x01 (ISA bridge),
thus a critical device database entry is required.

00:06.0 Bridge [0680]: NEC Corporation Star Alpha 2 [1033:002c] (rev 01)
    Subsystem: Unknown [0000:0000]
    Flags: bus master, medium devsel, latency 0

Addendum to commit 84fabd819d.

CORE-17977
2025-11-05 12:48:41 +03:00
Hermès Bélusca-Maïto
106dbed40d [BOOT] Actually add the remastering scripts in the ISOs
Addendum to commit fdc4272b1a (#4988)
CORE-8872
2025-11-03 20:22:42 +01:00
Hermès Bélusca-Maïto
fdc4272b1a [BOOT] Add an ISO remastering script (#4988)
CORE-8872

This is useful in the context of e.g. 3rd-party testers who want to
quickly add/remove/modify any file in a ReactOS ISO image and remastering
it without the need of our whole build environment.

remaster.cmd: Batch script.
remaster.sh : Almost-POSIX-compatible shell script version.
2025-11-03 20:08:39 +01:00
Hermès Bélusca-Maïto
6dd82ad146 [BOOT] Add the ISOMBR boot sector file in the ISO images (#4988)
This completes our set of provided boot sectors offered in the
ReactOS ISOs that can help for remastering those without our whole
build environment.
2025-11-03 20:06:48 +01:00
Justin Miller
3fe5b8b0bb [SDK][WDF][USBDEX][NTOSKRNL_VISTA] Fully enable KMDF (#8396)
[SDK][WDFLDR] Add kmdf loader driver
[SDK][WDF] Add kmdf drver init static library
[SDK][WDF] Modify kmdf driver for working with wdfldr driver
[SDK][CDROM] Cdrom driver dynamically linking with kmdf
[SDK][WDF] Add kmdfdriver module type
[SDK][WDF][USBDEX][NTOSKRNL_VISTA] Fully enable KMDF
[KMDF][WDFLDR][WDF01000] Fix Windows 10 Compatibility WDFLDR and WDF01000
[WDF01000] NO_KERNEL_LIST_ENTRY_CHECKS for wdf01000 3rd party code

This PR is an accumulation of three peoples work, with the goal of the trying to get WDF to work like it should.
This has been tested in combination with some extra NT6+ ntoskrnl against multiple drivers.

---------

Co-authored-by: Max Korostil <mrmks04@yandex.ru>
Co-authored-by: Victor Perevertkin <victor.perevertkin@reactos.org>
Co-authored-by: Adam Słaboń <asaillen@protonmail.com>
Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
2025-11-03 06:38:52 -08:00
Hermès Bélusca-Maïto
c7d4040767 [FREELDR] ArcGetFileInformation(): Set Information->FileName, Length, and Attributes for filesystems (#8420)
CORE-9023

Add support for all the supported filesystems: FAT/FATX, NTFS,
ISO, EXT, BTRFS, as well as for files loaded via PXE.

arc.h:
- Add `FILEATTRIBUTES` enumeration;
- Remove non-existing `CreateReadOnly` and `SupersedeReadOnly`
  `OPENMODE` values; add missing `CreateReadWrite`.
2025-10-19 22:38:30 +02:00
Hermès Bélusca-Maïto
eec9ca1305 [FREELDR] fs.c: Fix path device name lookup
Suppose the list of devices contains, for example listed in this order:

  `multi(0)disk(0)rdisk(0)partition(1)`,
followed by:
  `multi(0)disk(0)rdisk(0)`,

then if someone attempts to open `multi(0)disk(0)rdisk(0)`, the code
would erroneously open `multi(0)disk(0)rdisk(0)partition(1)` instead.

Device name lookup now verifies that the device name being tested has
the same length as the one being opened.

Noticed by user "Xen", see:
https://reactos.org/forum/viewtopic.php?p=144840#p144840
> Wrong name comparison in ArcOpen (can open "device()partition()"
> instead of "device()" that was really requested)
2025-10-19 21:23:12 +02:00
Hermès Bélusca-Maïto
b51789c28d [FREELDR] scsiport.c: Set the Information->Type field (#8418)
CORE-9023

And more accurately detect and report disks:
using `InquiryBuffer.DeviceType`, differentiate between "rigid" disks,
floppy disks, and CD-ROM drives.
2025-10-19 17:13:50 +02:00
Hermès Bélusca-Maïto
246f2d29db [FREELDR] ArcGetFileInformation(): Set the Information->Type field for devices (#8418)
CORE-9023

Some of this determination is platform-specific (e.g. BIOS-based PC vs.
NEC PC-98 vs. Xbox), and is done in a per-platform `DiskGetConfigType()`
routine.
This routine is then invoked by `hwdisk.c!DiskOpen()` and `PcInitializeBootDevices()`.
2025-10-19 17:13:49 +02:00
Hermès Bélusca-Maïto
5ce7d88397 [FREELDR] iso.h: Code doesn't use BIOS-specific DriveNumber
Addendum to commit e307cb2881 (r42528)
2025-10-14 14:15:48 +02:00
Hermès Bélusca-Maïto
d32b3e6e0a [FREELDR] ext.c/h: Use "standard" _S_IF* mode flags, exposed by fs/stat.h (#8413)
CORE-9023
2025-10-10 16:58:32 +02:00
Hermès Bélusca-Maïto
a9981acdce [FREELDR] Add a fs/stat.h file (#8413)
CORE-9023

The purpose of this file is to contain all the known `_S_IF*` flags
and `_S_IS*` macros, some of which are used by the FreeLoader *nix-based
file-systems.
2025-10-10 16:58:22 +02:00
Hermès Bélusca-Maïto
b39e6ee51c [FREELDR] Improve RamDisk loading loop (#8399)
CORE-9023

Do the seek to the beginning only once before starting the loop,
but avoid doing it for each chunk read: we base ourselves on the
fact that read operations automatically advance the internal read
pointer (per the specs).
2025-10-10 16:52:13 +02:00
Hervé Poussineau
8f6da8d78a [FREELDR] Fix RamDisk size determination; add some traces (#8399)
CORE-14603 CORE-9023

The RamDisk path specified with `/RDPATH=` can be a path to a block
device, like a disk partition, or the current boot disk (a ReactOS
specific feature added in commit 9b70d4380c), instead of being only
a file (as with Windows' NTLDR).

In this case, the `StartingAddress` and `EndingAddress` returned by
`ArcGetFileInformation()` are, per the specs, the start and end
positions of the partition as byte offsets from the start of the disk.
Therefore, the size of the partition is `== EndingAddress - StartingAddress`.

+ Add diagnostic traces in `RamDiskLoadVirtualFile()` and `RamDiskInitialize()`.

Co-authored-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
2025-10-10 16:52:12 +02:00
Hermès Bélusca-Maïto
d8a9159145 [FREELDR] setupldr.c: Allow empty RDPATH parameter (#8399)
Addendum to commit 9b70d4380c, that implemented the same but only
for the standard (non-Setup) ReactOS loader.

CORE-14603 CORE-9023
2025-10-10 16:52:12 +02:00
Eric Kohl
42d2453918 [BOOTDATA][KBDCR] Add the Slovenian keyboard layout
Croatian and Slovenian share the same keyboard layout file.
- Add the Slovenian keyboard layout to the registry.
- Modify the keyboard layout file description accordingly.

CORE-16194
2025-10-10 16:26:54 +02:00
Eric Kohl
974807294f [BOOTDATA][INPUT][KBDCMK] Add Colemak keyboard layout
- Add the Colemak keyboard layout. It is not done yet. Some deadkey translations are still missing.
- Add missing strings for the German Extended (E1) keyboard layout.

CORE-4463
2025-10-09 00:04:34 +02:00
Eric Kohl
88ec843e02 [KBD] Add German Extended 1 keyboard layout 2025-10-05 11:39:26 +02:00
Hermès Bélusca-Maïto
a0c427319f [FREELDR] Improve DiskGetExtendedDriveParameters()
- Move BIOS-specific `EXTENDED_GEOMETRY` structure to pcdisk.c

- Zero out the transfer buffer for INT 13h, function 48h before
  invocation. This ensures that any random data is removed and
  that some broken BIOSes behave better.

- Use a more suitable type for the pointer to the transfer buffer,
  so that we can use more human-manageable member names in TRACEs
  instead of magic buffer offsets.
2025-09-29 20:48:19 +02:00
Hermès Bélusca-Maïto
1375320ac4 [FREELDR] pc98disk.c: Simplify disk read checks in loops 2025-09-29 20:27:04 +02:00
Hermès Bélusca-Maïto
10b7a85991 [FREELDR] Fix the DPTE validity check, addendum to commit 4190b48924
Which is also an addendum to commit b3f11cfb38 (r17484).

The Enhanced Disk Drive Specification tells us that if the (far) pointer
to the Device Parameter Table Extension is set to FFFF:FFFF, the pointer
is invalid.

However there are some BIOSes, incl UEFI ones when running in Legacy
mode (e.g. GIGABYTE UEFI DualBIOS), that set this pointer to 0000:0000
instead, which is also an invalid value.
2025-09-29 20:13:30 +02:00
Hermès Bélusca-Maïto
4ffe8e86f0 [FREELDR] disk/fs: Improve some TRACEs and comments (#8400)
- Enhance some TRACEs.
- Improve printf formatters.
- Checking for success is part of the operation, no need to comment on that.
2025-09-29 20:09:44 +02:00
Hermès Bélusca-Maïto
9d3809febd [BOOTDATA] Disable logoff/password-change/workstation-lock in the LiveCD (#8373)
- Disable "Log Off" from the Start Menu and the C-A-D Security dialog;

- Disable the "Lock Workstation" and "Change Password" buttons in the
  Security dialog.

These are only "UI"-usability features to prevent the user from
logging off when running the LiveCD. (Logging off from the SYSTEM
account, and changing its password, don't make much sense.)

CORE-11397
2025-09-04 22:58:48 +02:00