Commit graph

661 commits

Author SHA1 Message Date
Hermès Bélusca-Maïto 9ae73010c2
[FREELDR] Factor duplicated code into a GetOSLoadingMethod() helper
This removes duplicated code present in both LoadOperatingSystem()
and EditOperatingSystemEntry().

+ Add SAL annotations to the related functions.
2024-03-12 17:15:02 +01:00
Hermès Bélusca-Maïto bbce6c3fdf
[FREELDR] Deduplicate common message-box creation code.
Also, make the (T)uiSave/RestoreScreen() helpers manage themselves the
temporary memory buffer used to store the temporary screen snapshot.
2024-03-11 22:37:39 +01:00
Hermès Bélusca-Maïto 64155019df
[FREELDR] Minor formatting for MsgBox functions + add SAL annotations 2024-03-11 22:37:38 +01:00
Hermès Bélusca-Maïto dad056e06a
[FREELDR] Move the arch-specific intrin_i.h inclusions to where they are actually needed (NTLDR) 2024-03-11 22:37:37 +01:00
Hermès Bélusca-Maïto 50e5f76212
[FREELDR] FrLdrHeapCreate: Show the memory type in the ERR(). 2024-03-11 22:37:36 +01:00
Hermès Bélusca-Maïto 9a707af2e3
[FREELDR] Initialize CandidatePageCount to zero, needed if the while-loop is not run.
Granted, if the while-loop is not run, this means there is no memory
available at all on the computer where FreeLdr is running, which is
quite unexpected. But do the initialization anyways, in order to avoid
more obscure bugs down the line.

On the other hand, PageLookupTableMemAddress doesn't need to be
pre-initialized, since it gets initialized unconditionally afterwards.
2024-03-11 22:37:35 +01:00
Hermès Bélusca-Maïto 61c4b5f615
[FREELDR] pcat.cmake: minor cleanup 2024-03-11 22:37:34 +01:00
Hermès Bélusca-Maïto b790cfcef1
[FREELDR] Pre-initialize the INI section list, improve loops over sections and items.
Avoids dereferencing list entries to sections/items when these lists are empty.

IniParseFile(): Emit an error to the debug log when a candidate setting
is outside a section and skip it, instead of popping up an error on the UI.
2024-03-11 22:37:33 +01:00
Hermès Bélusca-Maïto c8c32db8c5
[FREELDR] ueficon.c: Add missing support for HOME and END keys.
And reserve INSERT, PAGE_UP and PAGE_DOWN for future handling.
2024-03-11 22:37:33 +01:00
Hermès Bélusca-Maïto f4ff0aba2f
[FREELDR] Minor code cleanup in arch/uefi files 2024-03-11 22:37:32 +01:00
Hermès Bélusca-Maïto 1e409e6902
[FREELDR] i386/hwdisk.c: Use FIRST_BIOS_DISK and FIRST_PARTITION macros like what's done in UEFI code. 2024-03-11 22:37:30 +01:00
Katayama Hirofumi MZ 4e10ebed40
[BOOT] Don't create CSIDL_ADMINTOOLS folder in initial (#6551)
We shouldn't create an empty CSIDL_ADMINTOOLS folder at initial status.
JIRA issue: CORE-12328
- Modify boot/boot_images.cmake.
2024-03-11 11:24:26 +09:00
Hermès Bélusca-Maïto e1d334794a
[FREELDR][ROSSYM(_NEW)] Remove last vestigial references to "NTOSAPI".
This was a MinGW-specific, non-MS-DDK/WDK-compatible define, that was
used to mark NTOS kernel/hal exports, instead of NTSYSAPI etc.

We have since fixed that, and changed the way Freeldr (and rossym)
manages these, see commits:
186c8b72d (r16028), 51f0dfd30 (r17651) and 526efd2ee (r24359)
2024-03-07 13:35:08 +01:00
Katayama Hirofumi MZ c0b4db14de
[BOOTDATA][NTUSER] Prepare for CTF IME Part 1 (#6524)
Supporting TIPs...
JIRA issue: CORE-19360
- Add "IME File" registry value
  as "msctfime.ime" at
  HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\IMM.
- Modify UserIsCiceroEnabled
  function for preparation of
  CTF IME.
2024-02-24 01:53:16 +09:00
Andrei Miloiu 92a36b3613
[INF] Update Romanian (ro-RO) translation (#6359) 2024-01-21 22:25:00 +01:00
Hervé Poussineau 922757e2e3 [FREELDR:UI] Update display after restoring screen contents
JIRA issue: CORE-18186
2024-01-14 19:12:11 +01:00
Jose Carlos Jesus 2f2167abb0
[BOOTDATA] Add Portuguese (pt-PT) translation to hivecls.inf (#6218) 2024-01-11 11:59:11 +01:00
Andrei Miloiu 4d0080db9b
[INF] Update Romanian (ro-RO) translation (#6310) 2024-01-09 11:00:25 +01:00
Katayama Hirofumi MZ de7f1ceeef [BOOTDATA][INF] hivecls.inf: Add Japanese (ja-JP) translation
CORE-18706
2023-12-16 12:55:01 +09:00
Katayama Hirofumi MZ e2b1ee9a53
[SETUP][BOOTDATA][INF] Add font substitute ('Segoe UI Symbol' to 'Arial') (#6155)
Based on CORE-19346 "segoe-ui-symbo.patch".
In order to display gender glyphs (U+2642 and
U+2640; ♂ and ♀), we add a font substitute from
"Segoe UI Symbol" to "Arial".

ReactOS Arial has many symbol glyphs, so I think
we can use it for "Segoe UI Symbol" font substitute.

The glyph size problem will be fixed in #6156.
CORE-19346
2023-12-11 20:51:04 +09:00
Hermès Bélusca-Maïto 8ed5151d33
[BOOTDATA] Add explicit value types as we do for the others.
Addendum to commit fce106ab2.
2023-11-29 19:02:38 +01:00
Whindmar Saksit fce106ab25
[BOOTDATA] hivesft: Fix URL Protocol registry value (#6058)
"URL Protocol" is a registry value, not a key!

IEFrame later comes along and adds the value covering up the issue for everyone except poor gopher.
2023-11-29 20:40:19 +03:00
Justin Miller 516ccad340
[NTOS:KE][HALX86] Implement AP startup code (#5879)
Co-authored-by: Victor Perevertkin <victor.perevertkin@reactos.org>

Introduce the initial changes needed to get other processors up and into kernel mode. 
This only supports x86 as of now but is the first real step towards using other system processors.
2023-11-19 15:51:33 -08:00
George Bișoc fa80176a62
[FREELDR][HACK] Temporarily disable registry recovery code for AMD64
The newly implemented code for registry recovery makes the FreeLdr binary to grow
in size, to the point that it would BSOD because the PE image is too big.

For now we have to temporarily disable any of the newly added code, until
either FreeLdr is split into a basic PE bootloader image itself and a
"FreeLdrlib" that is used by the PE image to access various bootloader APIs
or another proper solution is found.
2023-11-19 20:44:28 +01:00
George Bișoc 7983b65e10
[FREELDR] Implement SYSTEM hive recovery at bootloader level & use CmCheckRegistry for registry validation
Validate the SYSTEM hive with CmCheckRegistry and purge volatile data with the same function when initializing a hive descriptor for SYSTEM.
Also implement SYSTEM recovery code that takes use of SYSTEM log in case something is fishy with the hive. If hive repair doesn't have fully recovered the SYSTEM hive, FreeLdr will load the alternate variant of the SYSTEM hive, aka SYSTEM.ALT.

If FreeLdr repairs the hive with a LOG, it will mark it with HBOOT_BOOT_RECOVERED_BY_HIVE_LOG on BootRecover field of the header. All the recovered data that is present as dirty in memory will have to be flushed by the kernel once it is in charge of the system.
Otherwise if the system boot occurred by loading SYSTEM.ALT instead, FreeLdr will mark HBOOT_BOOT_RECOVERED_BY_ALTERNATE_HIVE, the kernel will start recovering the main hive as soon as it does any I/O activity into it.
2023-11-19 20:44:28 +01:00
George Bișoc cce399e772
[ROSLOAD] Use CmCheckRegistry to purge volatile data 2023-11-19 20:44:28 +01:00
Katayama Hirofumi MZ 8860dc5393
[BOOTDATA] LiveCD: Enable Toggle key (Alt+Shift etc.) (#5985) 2023-11-16 22:23:11 +00:00
Dmitry Borisov 8d7153c8ba
[FREELDR] Implement NOSERIALMICE and FASTDETECT options (#5886)
Enable FASTDETECT by default, as done in NT 5+. This is because
the serial mouse is recognized by the serial stack since NT 5.x.
2023-11-13 19:49:41 +01:00
Hermès Bélusca-Maïto 10e7643c80
[FREELDR:NTLDR] Pass boot-time detection options to HwDetect routines.
Will be used for supporting /NOSERIALMICE, /FASTDETECT (NT 5+) switches
(see PR #5886), as well as the undocumented /PCIENUM option.
2023-11-13 19:19:40 +01:00
Justin Miller 0a951f1112
[BOOTDATA] Add SMP Entry (#5859)
[HALX86] Enable SMP Hal for x86
[BOOTDATA] add livecd and set entrys
2023-11-01 06:43:44 -07:00
Serge Gautherie 1fed9475cc
[BOOTDATA] vfatfs.sys is packaged for xbox only (#5805)
Addendum to 14c3936 (0.4.15-dev-5090).
CORE-16373
2023-10-20 13:19:41 +02:00
Dmitry Borisov 59d8a77df6
[DC21X4] Add driver for DECchip 21x4-compatible network adapters (#5614)
These adapters were common in DEC Alpha boxes and they are really rare
nowadays. The 21140 chip is emulated in Connectix / Microsoft Virtual PC
and Hyper-V Gen 1 VM.

This is an experimental driver, not yet tested on real hardware.

CORE-8724
2023-10-18 20:12:36 +03:00
Justin Miller ff3dadf89d
[FREELDR] Enable UEFI boot for x86 and amd64 (#5267)
Co-authored-by: Stanislav Motylkov <x86corez@gmail.com>
Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>

- Allow to boot NT kernel on UEFI systems with our 2 primary supported architectures
- Implement remaining code needed to pass execution to x86 and amd64 kernels

CORE-11954
2023-10-11 12:45:08 -07:00
Carl J. Bialorucki f744bb2994
[BROWSEUI] More settings and window refresh (#5584)
Adds the option to set the address edit box to use the display name or the full path. Also refreshes the window title and edit box in all open explorer windows when changing these settings using the folder options dialog.

## PROPOSED CHANGES ##
- Create a new CabinetStateSettings type that inherits from the CABINETSTATE type. This allows us to add additional cabinet state settings not exposed in the CABINETSTATE type as well as adding a Load() method to easily populate the cabinet state settings.

- Add a global cabinet state settings object. While most settings in browseui are stored independently in each shellbrowser window, cabinet state settings are global and apply to every shellbrowser window. This can be confirmed on Windows Server 2003 and Windows 7.

- When receiving the WM_SETTINGCHANGE window message from the folder options dialog, refresh the title of the window and the text in the address edit box. This is the same behavior as Windows Server 2003 and Windows 7.
Add a DWORD registry value to HKCU\...\Explorer\CabinetState\FullPathAddress to allow users to toggle this setting on or off in our folder options.

CORE-9277
2023-10-02 22:43:00 +02:00
Julio Carchi 4651faeaa2
[BOOTDATA] Add TEMP folder to livecd image (#5683)
Create the folder TEMP in X:\reactos so now we can match current livecd
environment variables TMP and TEMP
can be seen as a part of solving CORE-13041

The use-case for that is:
copying the livecd folder structure directly to writable media as USB sticks or memory cards,
will work then out-of-the-box without any other change.
2023-09-20 18:57:04 +00:00
Hermès Bélusca-Maïto 8a0e45031e
[BOOTDATA] Fix Standard Time description for "Mountain Standard Time (Mexico)"
CORE-11855

It was erroneously forgotten while making the timezone names translatable
in commit f25d0ce42 (r74415).
2023-09-02 21:53:07 +02:00
Serge Gautherie aa2d2139be [FREELDR] Convert ntfs.c to UTF-8 without BOM
Addendum to f0d73e0 (and ab3bd82).
2023-08-18 00:51:36 +02:00
Hermès Bélusca-Maïto ab3bd82928
[FREELDR] Convert source files to UTF-8 without BOM 2023-08-17 15:36:54 +02:00
Sylvain Deverre f0d73e0f7f
[BOOTSECT][FREELDR] Support booting from NTFS partitions (#3416)
Implement NTFS boot sector that loads FreeLdr from a NTFS partition.

CORE-17474

- Able to find/parse root directory;
- Handle fixups in FILE MFT record;
- Implement directory tree search;
- Implement loading found file from disk;
- Handle fixups in INDX records;
- Fail if compressed or sparse;
- Attempt to support 64-bit disks.

Some TO-DOs for later:
- Handle "weird" NTFS partition with uncommon sector sizes / sectors per cluster / sectors per index record;
- Better implementation for file loading;
- 64-bit LCN support.
2023-08-17 15:07:59 +02:00
Carl J. Bialorucki 43b3dc2034
[BROWSEUI] Refactor settings and sync them between windows (#5496)
This works similarly to how our shell stores its settings from a software design standpoint.

- Add settings.cpp file and ShellSettings structure to load and save settings.
- Add a registry value to hivedef.inf for the locked toolbar state.
  This prevents a bug where the associated registry key cannot be opened or saved to.
- Add new BWM_SETTINGCHANGE window message to refresh the UI on setting changes
  and send it to every open window when saving settings to the registry.
- Add new BWM_GETSETTINGSPTR window message to share the shellbrowser settings
  structure pointer with child windows and toolbars.
2023-08-17 12:14:41 +03:00
Dmitry Borisov ffbc81fdf2 [FREELDR] Implement bus mouse detection
This allows to automatically install the inport device driver
(it's now possible since 7d5e159131), which can be used on 86Box.

References:
- https://raw.githubusercontent.com/86Box/86Box/master/src/device/mouse_bus.c
- https://bochs.sourceforge.io/cgi-bin/lxr/source/iodev/busmouse.cc
2023-08-05 16:40:13 +03:00
Carl J. Bialorucki 6d37456542
[BROWSEUI] Add an option to use full folder path in the window title (#5468)
- Set `HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CabinetState\FullPath` to 0 by default.
  Adding this registry value also enables the "Display the full path in the title bar" option in our folder options window.
- Query the same registry key when the file explorer is started to determine whether to use the full path or the display name in the window title.

CORE-19046 CORE-18904
2023-07-22 17:50:39 +03:00
Katayama Hirofumi MZ 104ef25fcc
[ZIPFLDR][BOOTDATA] Support UTF-8 Zip packing (#5450)
New ReactOS can zip/unzip files and folders in UTF-8 filenames.
You can also choose the codepage of filenames to zip/unzip via
the ZipCodePage / UnZipCodePage registry values on the registry
key HKEY_CURRENT_USER\Software\ReactOS.

Windows 8 or later also support UTF-8 zipped folders.
You can also use 3rd party software to zip/unzip in older Windows.

- Use <atlconv.h> for string conversion.
- Use zipOpenNewFileInZip4_64 instead of zipOpenNewFileInZip3_64,
  and then add MINIZIP_UTF8_FLAG flag.
- Set the filenames in UTF-8 by using CP_UTF8 codepage.
- Codepage is user selectable via registry settings.

CORE-16668
2023-07-22 12:57:32 +09:00
Carl J. Bialorucki 4f542ebd8d
[BOOTDATA] Show Explorer status bar by default (#5443)
Enable the explorer status bar by default, which
the vast majority of our community voted for.

Set `HKCU\Software\Microsoft\Internet Explorer\Main\StatusBarOther`
to 1 in hivedef.inf. This will show the status bar by default.

CORE-19028 CORE-19010
2023-07-15 20:06:30 +03:00
Justin Miller e505394466
[FREELDR] Add UEFI Console input support. CORE-11954 (#5426)
Co-authored-by: Stanislav Motylkov <x86corez@gmail.com>
2023-07-11 11:07:31 -07:00
Carl J. Bialorucki 19c8574ec8
[EXPLORER] Show time and date when two lines are available in the taskbar clock area (#5410)
- Add registry key to show the time and date when two lines are available
  in the taskbar clock area.
- Keep old behavior when `PreferDateOverWeekday` registry key in
  `HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced`
  is set to 0 or not present.

When three or more lines are available, the clock will continue to show
the time, day of the week, and the date. When only one line is visible,
the clock will continue to only display the time.

CORE-19018
2023-07-09 01:04:45 +03:00
Hermès Bélusca-Maïto 3bc71f9086
[FREELDR][SCSIPORT][STORPORT] Use existing defines for some hardcoded max values.
See https://www.osronline.com/article.cfm%5Earticle=538.htm

[SCSIPORT] Remove 'MaxBus' variable, deprecated since commit fc3d38d1c (r26220).
2023-06-19 21:10:51 +02:00
Hermès Bélusca-Maïto 0c16bcd4e8
[FREELDR] scsiport.c: Fix x64 compilation. 2023-06-19 21:09:01 +02:00
Hermès Bélusca-Maïto af47866f76
[FREELDR:UEFI] Fix compilation warning LNK4006.
ntoskrnl.c.obj : warning LNK4006: _KeStallExecutionProcessor@4
already defined in stubs.c.obj; second definition ignored.
2023-06-19 21:09:00 +02:00
Hermès Bélusca-Maïto 095510bdac
[FREELDR:UEFI] Fix two MSVC build warnings C4553.
In both lines 451 and 474:
uefidisk.c: warning C4553: '==': result of expression not used; did you intend '='?

It's "funny" that GCC builds doesn't catch those...
2023-06-19 21:08:59 +02:00