Commit graph

199 commits

Author SHA1 Message Date
Hermès Bélusca-Maïto d887308b2f
[FREELDR] Parse NT kernel load options in a consistent manner.
- Introduce a set of NtLdrGet(Next)Option(Ex) helpers that allow
  retrieving respectively, the "next" option in an options string,
  and retrieving a given named option in such an options string,
  by correctly parsing that string.

  Valid syntaxes:
      /OPTION1 /OPTION2/OPTION3 OPTION4 /OPTION5(=...) ...

  Options separators are slashes, or whitespace (space, tab), mandatory
  if no slash is used, and otherwise optional.

- Use these functions wherever NT load options are being parsed.

- Simplify the parsing of /DEBUGPORT=... using these functions.

- When parsing the /HAL=... or /KERNEL=... options, only the first
  encountered one is taken into account, any other ones are discarded.

- When parsing the other load options, only their first occurrences are
  taken into account, any other repetitions are discarded.
  * The NOPAE option overrides any previous PAE option.
  * Any NOEXECUTE(=) option should override any previous
    NOEXECUTE=ALWAYSOFF (or equivalently, EXECUTE) option.
2020-11-03 01:52:47 +01:00
Hermès Bélusca-Maïto d8547a8f20
[FREELDR] In LoadReactOSSetup(), verify that our BootType is really ReactOSSetup. 2020-11-03 01:52:47 +01:00
Hermès Bélusca-Maïto 3033580c1a
[FREELDR] Minor code formatting / renaming some variables. 2020-11-03 01:52:46 +01:00
Hermès Bélusca-Maïto 04b4e3b05d
[FREELDR] Fix the parameter type of WinLdrSetupEms()
It's a NULL-terminated string. And thus avoid an unelegant cast.
2020-11-03 01:52:36 +01:00
Hermès Bélusca-Maïto 58866a112a
[FREELDR] Remove the 'Setup' parameter of the LoadAndBootWindowsCommon() function.
This parameter is not needed since it's possible to determine, from
within this function, whether or not we are in Setup mode, by just
looking for the presence of a non NULL LoaderBlock->SetupLdrBlock.
2020-11-03 01:51:48 +01:00
Hermès Bélusca-Maïto 64ca7f6427
[FREELDR] Remove trailing whitespace. 2020-11-03 01:51:47 +01:00
Jérôme Gardou 00ed72d7e8 [CMAKE] Get rid of add_compile_flags
Use add_compile_options and the like instead
2020-10-20 21:44:54 +02:00
Jérôme Gardou 7e116f0ef3 [CMAKE] Get rid of replace_compile_flags
Introduce a finer-grained remove_target_compile_option instead
2020-10-20 21:44:54 +02:00
Stanislav Motylkov 8a4273b6ee
[FREELDR] Add variable for default text color
On PC/AT-compatible machines it's Gray, and on NEC PC-98 series it's White.
2020-10-17 19:28:08 +03:00
Stanislav Motylkov db1b04340f
[FREELDR] Use BIOS font and accelerated text drawing on NEC PC-98
Both features are switchable via global variables.
2020-10-17 19:28:05 +03:00
Serge Gautherie 889b077b23
[REACTOS] *.spec: Fix some function/parameter types (#3154) 2020-09-20 19:21:11 +02:00
Timo Kreuzer 2aca4b2795 [ASM] Fix boot with VS 16.7.3 / MSVC 19.27
See https://developercommunity.visualstudio.com/content/problem/1180800/ml-x86-assume-directive-causes-invalid-code-genera.html
2020-09-12 15:01:04 +02:00
Stanislav Motylkov 2a77e359e4
[XBOX] Move NV2A XGPU definitions into header file
TODO: helper functions should be also moved. CORE-16216
2020-08-26 16:58:01 +03:00
Stanislav Motylkov f420f2e5df
[XBOX] Move SuperIO definitions and helpers into header file
CORE-16216
2020-08-26 02:06:19 +03:00
Thomas Faber 794d00c303
[FREELDR][NETKVM][ATL_APITEST] Pick the GCC code path for clang in some cases. CORE-17202 2020-08-23 12:07:37 +02:00
Thomas Schneider a245c98fc6
[FREELDR] Bootsector fix for CHS read on old BIOSes which lack INT 3e (#3078)
At line 263 a 'pop es' is missing before 'ret' in ReadCHS() function,
just like in the ReadLBA() function. CORE-17178

Co-authored-by: Dmitry Borisov <di.sean@protonmail.com>
2020-08-19 19:10:02 +03:00
Stanislav Motylkov 415c737cc3
[FREELDR] Add display controller detection for Xbox
Also add system identifier here.

[BOOTDATA] Fix some typos

CORE-16216
2020-06-09 22:02:09 +03:00
Stanislav Motylkov 092bc78a42
[FREELDR] Fix register offset
Addendum to 10e52f6.
2020-06-03 02:04:07 +03:00
Hervé Poussineau 468b8f3719 [FREELDR] Fix I/O range size of serial ports 2020-05-17 23:08:26 +02:00
Dmitry Borisov 98c17d3120
[FREELDR] Add vertical screen scrolling for Xbox with console mode (#2745)
Also turn off debug messages to screen before setting up the CPU (To print a character to the screen on some ports the MMIO access should be executed, so it throws an exception).

CORE-16216
2020-05-10 18:35:51 +02:00
Stanislav Motylkov 10e52f68b2
[FREELDR] Fix some more register accesses and magic values
Addendum to 764e884.
2020-05-08 23:02:42 +03:00
Joachim Henze 7c81fb8f56 [FREELDR] Workaround regression CORE-16469
This prevents ReactOS asserting when 'My computer'
is opened, while it tries to send commands to floppy drive.

Many thanks to patches author Doug Lyons.

The regression was introduced by 0.4.13-dev-1081-g
eeff926ede

patch was committed to 0.4.13rls and 0.4.14rls as well.

Today it was committed to master as well, as
the initially planned investigation for the root cause
did still not happen and we can not afford the time
to retest and workaround this over and over again.
Thank god that Oleg Dubinskiy was still around to retest
this again and confirmed it can still happen, because
unlike initially, personally I was not able to reproduce it
today anymore!

Since every release was work-arounded, we did never
expose the bug in any final release.
2020-05-06 23:45:37 +02:00
Stanislav Motylkov 764e884f5e
[FREELDR] Work with Xbox GPU memory registers properly
Bug was noticed with GCC 8.4
2020-05-02 23:23:33 +03:00
Dmitry Borisov 4501bbac8f
[KDCOM][NTOS:INBV][FREELDR] Decrease default baud rate for PC-98 target (#2601)
According to PC-9801 Bible p. 50, divisor for PIT will become unsupported in some cases after having removed the fractional part. Replace 19200 value with 9600 which is supported by both 10 MHz and 8 MHz machines.
2020-04-21 23:22:42 +03:00
Dmitry Borisov 61d966bf1a
[FREELDR] Fix typos and PC-98 boot (#2564)
- INT 18h, AH=A0h doesn't exist, it was meant to be AH=0Ah. Thanks to SimK (@simk98l) on twitter for bug reporting and fix.
- Adress -> Address.
2020-04-17 20:27:20 +02:00
Victor Perevertkin 7e069ccdb2
[CMAKE] Replace custom functions to built-in ones
add_target_compile_definitions -> target_compile_definitions
add_target_compile_flags -> target_compile_options
add_target_include_directories -> target_include_directories
2020-04-16 15:59:38 +03:00
Adam Słaboń 7b24d00ef1
[FREELDR][INSTALL][FDEBUG] Include FreeLDR tools in LiveCD and HybridCD (#2550)
It might be useful to have them on LiveCD/HybridCD as well.
2020-04-15 12:37:21 +02:00
Victor Perevertkin 92dfec219d
[CMAKE][CONFIGURE] Enable runtime checks on MSVC by default.
Remove RTC switch from configure.cmd, now MSVC runtime checks are
supposed to be enabled/disabled via CMake define (-DRUNTIME_CHECKS=1)
Prepare for adding more dynamic analysis options
2020-04-11 02:48:12 +03:00
Mas Ahmad Muhammad b8dd046ee4
[TRANSLATION] Add and update Indonesian translations (#2506)
- CMDUTILS: attrib, label (update translation)
- USETUP (add translation)
- HOTPLUG (add translation)
- CONSRV  (update translation)
- USERSRV (update translation)
- USER32  (update translation)
- ACLUI  (update translation)
- LICCPA  (update translation)
- SUBST  (update translation)
- REGSVR32  (update translation)
- REGEDIT-CLB  (update translation)
- ACPPAGE  (update translation)
- TIMEDATE  (update translation)
- SOLITAIRE  (update translation)
- FDEBUG  (update translation)
- SYSSETUP (update translation)
2020-04-09 18:49:45 +02:00
Vadim Galyant 305e856ef8
[FREELDR] Add parsing boot options from .ini files. (#2511)
Co-Authored-By: Stanislav Motylkov <x86corez@gmail.com>
2020-04-09 16:25:25 +02:00
Mark Jansen 177ae91bf6
[RTL] Introduce RtlpImageNtHeader,
which implements the required functionality.
ntdll and ntoskrnl now have a wrapper for this, with SEH.
This protects the function against malformed / bad images,
whilst still being able to use the code in freeldr et al.
Idea from Thomas.
CORE-14857
2020-03-29 21:27:38 +02:00
Stanislav Motylkov dc7eac583f
[FREELDR] Move built-in VGA font to better location (#2429)
Addendum to 97eacb9.
2020-03-14 18:13:49 +01:00
Dmitry Borisov 97eacb9fb4 [FREELDR] Minor code improvements
- Add missing allocation check in DetectApmBios()
- Check 'PM' signature in FindApmBios()
- Properly set machine type in hardware detection
- Set Component->Key value for hard drives
- Get rid of the unused XboxBeep()
- Cast Xbox LPC I/O ports to PUCHAR
- Improve shadow rendering with VGA font
- Include ntoskrnl.h in the proper order
2020-03-07 00:52:40 +01:00
Dmitry Borisov c14cc22bfd [FREELDR] Add ARC-emulation support for NEC PC-98 series
- Add ARC-emulation support for NEC PC-98 series
- Add global definition for PC-98 port into CMakeLists.txt
- Add floppy verison of freeldr.ini for PC-98 CD boot
2020-03-07 00:52:40 +01:00
Hermès Bélusca-Maïto 93beefacbe
[CMAKE][FREELDR] Take the global defines into account when compiling ASM files.
Now the SARCH_xxx can be used in ASM files too.
Dedicated to Dmitry Borisov ;)
2020-03-06 22:55:12 +01:00
Dmitry Borisov 222e79232c
[CPORTLIB][NTOS:INBV][KDCOM][FREELDR] Add ComPort library for NEC PC-98 series (#2407)
There are 2 known serial ports:
    COM1 - based on Intel 8251A
    COM2 - National Semiconductor 16550
2020-03-06 19:50:31 +01:00
Dmitry Borisov 74eda39118
[FREELDR] Move the PC VESA and hardware detection libraries into the PC directory (#2355)
Because it contains platform-specific code.
2020-03-01 20:41:47 +01:00
Victor Perevertkin 1d069269f5
[FREELDR] Fix build by adding a missing header 2020-02-15 18:25:57 +03:00
Dmitry Borisov 747d50c52e
[FREELDR] Separate PC beep routines out into its own file (#2347)
- Remove now unused i386rtl.c (and it doesn't contains RTL functions nowadays).
- Separate PC beep routines out into its own file.
- Also use delay function instead of BIOS interrupts.
- Improve as well the accuracy of KeStallExecutionProcessor() by using the same HW delay function.
2020-02-14 19:22:17 +01:00
Stanislav Motylkov 571407c7d2 [FREELDR] Separate PC and Xbox platform-specific code (#2185)
CORE-16216
2020-02-14 16:02:04 +01:00
Stanislav Motylkov 6c4e591ea9 [FREELDR] Restructure platform-specific code. No code changes. 2020-02-14 16:02:04 +01:00
Dmitry Borisov a55bab8d1d
[FREELDR] Fix IDE driver failures on real hardware. (#2255)
- Changes in device detection code:
    * Properly check device signature.
    * Сorrectly reset the IDE controller.
    * Remove check for device type code.
- Fix CD-ROM sector read issue:
    * Changed ATAPI packet opcode to be more universal (Some devices may not have READ12 support).
    * Always use 2048 bytes as sector size when reading the data from a disc.
    * Modify WaitForFlags() to stop polling if the error bit was set.
    * Changed timeout to 31 seconds (ATA default value).
- Add more informational messages in DEBUG mode.
- Fix invalid IDE register value.
- Fix registers names.

Tested by Stanislav Motylkov and Daniel Reimer on XQEMU and on real
hardware MS Xbox revision 1.3 with Philips DVD drive.
It has also been tested manually on PC with a SONY DVD drive.

CORE-16628 CORE-16216
2020-02-13 18:10:02 +01:00
Dmitry Borisov dc81ecf84b
[FREELDR] Fix indentation. No code changes 2020-02-13 18:10:01 +01:00
Dmitry Borisov e00ea7dadd
[FREELDR] Properly set keyboard flags in hardware detection (#2288)
See https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/ns-wdm-_cm_keyboard_device_data
2020-01-29 16:49:31 +01:00
Hermès Bélusca-Maïto 94dab57ef9
[FREELDR] Rework BTRFS filesystem to not be tied to a fixed global volume. CORE-16646 2020-01-26 18:48:17 +01:00
Hermès Bélusca-Maïto f4fdc957c5
[FREELDR] Use RTL copy/zero-memory helper functions. 2020-01-26 18:48:14 +01:00
Hervé Poussineau 46fdc89e4f [FREELDR] Comment out useless variable 2020-01-22 20:56:51 +01:00
Dmitry Borisov 065afd93fd [FREELDR] Add FAT12 file system boot sector for NEC PC-98 series (#2025)
The first part of PC-98 Port - https://reactos.org/wiki/PC-98

- Add FAT12 file system boot sector for NEC PC-98 series.
- Add a new build target for a PC-98 bootable floppy disk.
- Add a new sub-architecture into config.cmake.
2020-01-18 19:16:23 +01:00
Stanislav Motylkov afdb42023c [FREELDR][XBOXVMP] Check only low 28 bits for framebuffer address (#2249)
Fixes framebuffer detection on real hardware Xbox.
2020-01-14 20:20:22 +01:00
disean e5c0052466 [HAL][FREELDR] Fix system timer oscillator frequency on a Xbox (#2245)
See https://xboxdevwiki.net/Porting_an_Operating_System_to_the_Xbox_HOWTO#Timer_Frequency
2020-01-14 18:47:36 +01:00