ROS Port AMD64 — различия между версиями

Материал из Русский WINE
Перейти к: навигация, поиск
(Новая страница: «== Building == Obtain the React OS Build Environment for ARM (RosBE-ARM). The latest version is 1.0 and available from: [http://reactos.colinfinck.de/download/Ro…»)
 
(Ссылки)
 
(не показано 9 промежуточных версии 2 участников)
Строка 1: Строка 1:
== Building ==
+
Данная страница описывает текущее состояние портирования ReactOS на AMD64. AMD64 относится к спецификациям AMD для 64-битного расширения набора x86-инструкций. Так же известна как x86-64 (или x86_64 и x64).
  
Obtain the React OS Build Environment for ARM (RosBE-ARM). The latest version is
+
В {{rev|34699}} Timo Kreuzer создал ветку [http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/ ros-amd64-bringup] для работы над данным портом.
1.0 and available from: [http://reactos.colinfinck.de/download/RosBE-Windows/RosBE-ARM-1.0.exe http://reactos.colinfinck.de/download/RosBE-Windows/RosBE-ARM-1.0.exe].
+
  
Launch the RosBE-ARM command prompt, and type "makex" on the command line. After
+
= Состояние =
some minutes, you should have the whole tree built.
+
Ntoskrnl:
 +
*[http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kd/amd64/?view=log kd/amd64]
 +
*[http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kd64/?view=log kd64]
 +
*[http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kdbg/amd64/?view=log kdbg/amd64]
 +
*[http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/amd64/?view=log ps/amd64]
 +
*[http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/amd64/?view=log include/internal/amd64]
 +
*[http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/amd64/?view=log ke/amd64]
 +
MM:
 +
*[http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/amd64/?view=log mm/amd64]
 +
Freeldr:
 +
*[http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/amd64/?view=log freeldr/arch/amd64]
 +
HAL:
 +
*[http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/amd64/?view=log hal/halx86/amd64]
  
== Making a RAM disk ==
+
* Все собирается
 +
* Bootcd создается
 +
* setupldr загружается, переключает процессор в long mode, инициализирует оборудование/память/подкачку и переходит к ntoskrnl
 +
* Базовая инициализация Mm выполняется, но затем, система падает
 +
* Non paged pool allocations работает
 +
* Отладка с помощью WinDbg (break points, single stepping и пр.) работает
 +
* При включении прерываний всё ломается
  
Currently, the ARM port will only boot from a RAM disk, either in NOR/NAND flash
+
== Статус реализации (приблизительно) ==
on a real device, or an emulated one like QEMU. A RAM disk is a simple flat image
+
{| class="wikitable"
file that is loaded into memory.
+
!
 +
! реализация
 +
! комментарий
 +
|-
 +
| freeldr    || 95% || ожидаются только исправления
 +
|-
 +
| hal        ||  5% || на первичной стадии разработки, не хватает поддержки прерываний
 +
|-
 +
| ntoskrnl/ke || 50% || базовая функциональность реализована
 +
|-
 +
| ntoskrnl/mm || 10% || немного функций реализовано, большинство их отсутствует
 +
|-
 +
| rtl        || 60% || exception handling is missing and unwinding is incomplete
 +
|-
 +
| crt        || 60% || missing stuff here and there
 +
|-
 +
| [[PSEH]]    ||  0%                              100% in MSVC || <s>'''Showstopper for AMD64 branch. Unimplemented: It waits for SEH support in mingw-w64 version of GCC compiler''' </s>
 +
See also [[Building_MINGW-w64]], [[Techwiki:SEH64]]
  
To generate one of these images, you may use a tool such as qemu-img, the Mac OS
+
Not a problem anymore with MSVC compiler http://www.dreimer.de/?p=1212
Disk Image utility, or any other tool capable of generating a raw image file that
+
|}
corresponds to a hard disk image. You should generate a RAM disk of 32MB or less.
+
  
You then need a tool (on Windows), or the proper set of commands, to mount this
+
==Сборка порта amd64==
virtual file/image as an actual hard drive on your machine. This step is required
+
Во-первых, установите [http://dreimer.eu/rosbe/RosBE64.7z Amd64 addon for RosBE] (взято [http://www.reactos.org/forum/viewtopic.php?f=9&t=9082 отсюда]), и запустите 64-разрядную сессию RosBE, подправив ярлык:
as the ARM port does not have an "installer" of any sorts, and cannot partition
+
your disk, so you must do so yourself.
+
  
On a system such as Linux, you can use a local loopback mount, and then launch
+
Ярлык для i386 выглядит так:
mkfs_fat on the mounted device. You can use either FAT16 or FAT32, as both have
+
C:\Windows\System32\cmd.exe /t:0A /k "e:\RosBE\RosBE.cmd"
been tested with success. On OS X, the Disk Utility will automatically ask you
+
to partition/format the image. Make sure you select "MS-DOS" partitioning when
+
asked. On Windows, you may need to obtain a tool that can mount such images, such
+
as vdkmount. Alternatively, you may use this image as an x86 ReactOS hard disk in
+
QEMU, and then launch the x86 ReactOS setup program. Continue through the installer
+
pages until you reach the formatting step, and allow ReactOS setup to format the
+
disk. After that, you should be able to quit QEMU and have a formatted image file.
+
  
IMPORTANT: Usually, your raw image file will look like a real "disk". It will have
+
А для AMD64 его необходимо изменить:
an MBR sector at 0x00000000, followed by a boot sector for your first partition
+
somewhere else on the disk. Sometimes this is at sector 63, 2, 1, 60, etc. You
+
will need to know the offset of where the partition starts. Often this will be
+
0x7E00 (32256), although on Mac OS X .dmg images it will be 0x200. This offset is
+
easy to find, either with a tool that understands your image file when mounting it,
+
or by using a hex editor and locating the boot sector (look for "FAT").
+
  
== Installing ==
+
C:\Windows\System32\cmd.exe /t:0A /k "e:\RosBE\RosBE.cmd" amd64
  
Now that you have a mountable, formatted, FAT image file, go ahead and mount it,
+
'''(И для ARM:'''
and set your ROS_INSTALL environment variable to the \reactos folder on the virtual
+
C:\Windows\System32\cmd.exe /t:0A /k "e:\RosBE\RosBE.cmd" arm
drive. For example, if you mapped it to X:\, this would be ROS_INSTALL=X:\reactos.
+
''')'''
  
Now issue a "makex install" from the RosBE command line. This will copy all the
+
Здесь "''e:\RosBE''" - путь к установленной RosBE.
files to your new RAM disk.
+
  
The last thing you'll need is a freeldr.ini. You can write one from scratch, or
+
Запустите исправленный ярлык, и затем, собирайте ReactOS как обычно ([[ROS Build|'''ninja bootcd''']] и пр.).
simply take the usual one that the x86 ReactOS setup program installs on your
+
Вы можете собрать amd64 и arm в том же транке где у вы собираете x86. При сборке будут созданы новые каталоги, а у ISO-образа будет имя другое имя: ''ReactOS-amd64.iso''.
x86 ReactOS partition/image file. You'll want to keep the ReactOS entry that's
+
marked as "(RAMDisk)".
+
  
== Preparing to boot ==
+
''(или ReactOS-arm.iso для ARM)''.
 
+
Now that you have a RAM disk, you are ready to build the final components. The
+
ARM port basically uses an LLB (Low-Level Bootloader) to initialize the hardware,
+
and then pass control to FreeLDR, the ReactOS Boot Loader. FreeLDR will then use
+
the RAM disk to search for freeldr.ini, present the OS options, etc, and finally
+
load the kernel.
+
 
+
Therefore, there are three components that the system needs: the LLB, the loader,
+
and the RAM disk. QEMU has command-line options and support for only loading two
+
image files, and so the LLB and the loader must be fused together into one binary
+
file. Additionally, the RAM disk image file you created must be slightly modified
+
for technical reasons beyond the scope of this document.
+
 
+
Thankfully, a tool exists to perform these operations: nandflash. You simply need
+
to run nandflash (from your output-arm/tools/nandflash directory) with the "1"
+
option to instruct it to generate the necessary files. The other use of nandflash
+
(without the parameter) is to generate OMAP3 ROM NAND flash files, but that usage
+
is beyond the scope of this document.
+
 
+
Note that nandflash expects your image file to have been called ramdisk.img, so
+
make sure you rename it to match this. After running nandflash, you will have
+
two new files: ramdisk.bin, which is a modified version of your ramdisk image,
+
and reactos.bin, which is the fused LLB and loader together.
+
 
+
== Booting ==
+
 
+
You can now instruct QEMU to boot ReactOS for ARM. You will need to obtain the
+
ARM version of QEMU (qemu-system-arm) or build it yourself. Currently, testing
+
is done with the "Versatile/PB" platform, but with a modified CPU target being
+
the Cortex A8, an ARMv7-a core, which is being used internally for BeagleBoard
+
and ZoomII-MDK work. Although the original ARM port of ReactOS was designed for
+
ARMv5 and ARMv4, these cores have an MMU that is incompatible with ReactOS/Windows
+
requirements, and lacks instructions needed for synchronization done in user-mode.
+
To specify these two options, use "-M versatilepb -cpu cortex-a8" on your command
+
line.
+
 
+
You now need to specify the two files that nandflash created for you. You may do
+
this with the following two options: "-kernel reactos.bin -initrd ramdisk.bin".
+
 
+
Finally, you need to tell the LLB that we are booting from a RAM disk, and you
+
need to input the boot sector offset we talked about earlier. You can do this with
+
the following options: "-append boot-device=RAMDISK,rdoffset=0x200". In general,
+
"-append" is used to send command-line parameters to the LLB, and you can specify
+
additional options by comma-separating them.
+
 
+
Here is an example final command line for QEMU:
+
"qemu-system-arm -M versatilepb -cpu cortex-a8 -kernel reactos.bin -initrd ramdisk.bin -append boot-device=RAMDISK,rdoffset=0x200"
+
 
+
Past this point, the experience should be familiar. Note that the only thing you
+
can do for now is select the OS from the boot selection menu, and see it load a
+
couple of drivers and hang somewhere in the kernel.
+
 
+
=Status=
+
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/?view=log
+
 
+
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halarm/?view=log
+
 
+
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/armllb/?view=log
+
 
+
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/arm/?view=log
+
 
+
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/arm/?view=log
+
 
+
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/rtl/arm/?view=log
+
 
+
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/arm/?view=log
+
 
+
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/arm/?view=log
+
 
+
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/arm/?view=log
+
 
+
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halarm/?view=log
+
 
+
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/?view=log
+
 
+
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/arm/?view=log
+
 
+
[http://svn.reactos.org/svn/reactos?revision=56035&view=revision r56035]: Two Part Patch which fixes ARM3 Section Support (not yet enabled). This had been enabled in the past for testing and resulted in bizare crashes during testing. The amount of fixing required should reveal why:
+
==Part 1: Page Fault Path Fixes==
+
 
+
*[NTOS]: As an optimization, someone seems to have had changed the MiResolveDemandZeroFault prototype not to require a PTE, and to instead take a protection mask directly. While clever, this broke support for ARM3 sections, because the code was now assuming that the protection of the PTE for the input address should be used -- while in NT Sections we instead use what are called ProtoType PTEs. This was very annoying to debug, but since the cause has been fixed, I've reverted back to the old convention in which the PTE is passed-in, and this can be a different PTE than the PTE for the address, as it should be.
+
*[NTOS]: Due to the reverting of the original path, another optimization, in which MiResolveDemandZeroFault was being called directly instead of going through MiDispatchFault and writing an invalid demand-zero PDE has also been removed. PDE faults are now going through the correct, expected path.
+
*[NTOS]: MiResolveDemandZeroFault was always creating Kernel PTEs. It should create User PTEs when necessary.
+
*[NTOS]: MiDeletePte was assuming any prototype PTE is a forked PTE. Forked PTEs only happen when the addresses in the PTE don't match, so check for that too.
+
 
+
==Part 2: ARM3 Section Object Fixes==
+
*[NTOS]: Fix issue when trying to make both ROS_SECTION_OBJECTs and NT's SECTION co-exist. We relied on the *caller* knowing what kind of section this is, and that can't be a good idea. Now, when the caller requests an ARM3 section vs a ROS section, we use a marker to detect what kind of section this is for later APIs.
+
*[NTOS]: For section VADs, we were storing the ReactOS MEMORY_AREA in the ControlArea... however, the mappings of one individual section object share a single control area, even though they have multiple MEMORY_AREAs (one for each mapping). As such, we overwrote the MEMORY_AREA continously, and at free-time, double or triple-freed the same memory area.
+
*[NTOS]: Moved the MEMORY_AREA to the "Banked" field of the long VAD, instead of the ControlArea. Allocate MMVAD_LONGs for ARM3 sections for now, to support this. Also, after deleting the MEMORY_AREA while parsing VADs, we now use a special marker to detect double-frees, and we also use a special marker to make sure we have a Long VAD as expected.
+
  
 +
== Ссылки ==
 +
* ViewVC of [http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/ ros-amd64-bringup]
 +
* [http://www.nynaeve.net/?p=99 Nynaeve: Programming against the x64 exception handling support]
 +
* [http://github.com/reactos/reactos/pull/115 PR с улучшениями x64 на github]
 +
* [http://github.com/reactos/reactos/pull/361 PR Загрузка в пользовательский режим x64]
 +
* [http://youtu.be/qZ9KvJv7P3E Проба загрузки ReactOS x64 от 01.01.2018]
 +
* [http://youtu.be/-rgsXXbs2FA Загрузка ReactOS x64 от 31.05.2019 + livecd] + [https://yadi.sk/d/ZLiZ-9NyP8cmnQ (зеркало)]
 +
* [https://drive.google.com/file/d/1_7eG_29EnQb7xHtqN9EGr2bRisHDhpuB/view Рабочие ISO-образы]
 
{{ReactOS}}
 
{{ReactOS}}
 
[[Категория:Переводится]]
 
[[Категория:Переводится]]

Текущая версия на 01:43, 7 февраля 2020

Данная страница описывает текущее состояние портирования ReactOS на AMD64. AMD64 относится к спецификациям AMD для 64-битного расширения набора x86-инструкций. Так же известна как x86-64 (или x86_64 и x64).

В r34699 Timo Kreuzer создал ветку ros-amd64-bringup для работы над данным портом.

Состояние

Ntoskrnl:

MM:

Freeldr:

HAL:

  • Все собирается
  • Bootcd создается
  • setupldr загружается, переключает процессор в long mode, инициализирует оборудование/память/подкачку и переходит к ntoskrnl
  • Базовая инициализация Mm выполняется, но затем, система падает
  • Non paged pool allocations работает
  • Отладка с помощью WinDbg (break points, single stepping и пр.) работает
  • При включении прерываний всё ломается

Статус реализации (приблизительно)

реализация комментарий
freeldr 95% ожидаются только исправления
hal 5% на первичной стадии разработки, не хватает поддержки прерываний
ntoskrnl/ke 50% базовая функциональность реализована
ntoskrnl/mm 10% немного функций реализовано, большинство их отсутствует
rtl 60% exception handling is missing and unwinding is incomplete
crt 60% missing stuff here and there
PSEH 0% 100% in MSVC Showstopper for AMD64 branch. Unimplemented: It waits for SEH support in mingw-w64 version of GCC compiler

See also Building_MINGW-w64, Techwiki:SEH64

Not a problem anymore with MSVC compiler http://www.dreimer.de/?p=1212

Сборка порта amd64

Во-первых, установите Amd64 addon for RosBE (взято отсюда), и запустите 64-разрядную сессию RosBE, подправив ярлык:

Ярлык для i386 выглядит так:

C:\Windows\System32\cmd.exe /t:0A /k "e:\RosBE\RosBE.cmd"

А для AMD64 его необходимо изменить:

C:\Windows\System32\cmd.exe /t:0A /k "e:\RosBE\RosBE.cmd" amd64

(И для ARM:

C:\Windows\System32\cmd.exe /t:0A /k "e:\RosBE\RosBE.cmd" arm 

)

Здесь "e:\RosBE" - путь к установленной RosBE.

Запустите исправленный ярлык, и затем, собирайте ReactOS как обычно (ninja bootcd и пр.). Вы можете собрать amd64 и arm в том же транке где у вы собираете x86. При сборке будут созданы новые каталоги, а у ISO-образа будет имя другое имя: ReactOS-amd64.iso.

(или ReactOS-arm.iso для ARM).

Ссылки

ReactOS
Search.png
Доклады
О ReactOSARWINSSЧеЗа
Информация Новости Выпуски новостейПереводы блоговНовости проектаВидеоReactOS на ХабреUSB от Вадима Галянта
Разработка Руководство по программированиюОтсутствующая функциональностьВетви разработкиКомпоненты системыReactOS и WineПлан работRoadmap ядра by VgalРазработчикиСовместимость с dll WindowsНаиболее значимые изменения за годИспользуемые проектыGoogle Summer of CodeИзвестные проблемы
Порты AMD64ARMXboxPowerPC
Компоненты Файловые системыРежим совместимостиОтчеты об ошибкахПечатьUSBЯдро
Загрузчик Восстановление MBRЗагрузка из GRUBПараметры загрузки
Прочее ARWINSSПриложения в ReactOSОформление ReactOSКоординаторы"Пасхальные яйца"Монетизация
Другое Типы ядерFreeWin95
Помощь
RAM-диск ReactOS по PXEс жесткого диска
Разработка Стиль написания кодаСтандарты RC-файловРабота с документациейВенгерская нотацияGNU Indent • [ Subversion : ветвислияниеиспользование TortoiseSVN ] • Основы переводаОтправка патчей
Репорты Отладка в VirtualBoxОтладка на экранДобавление программы в менеджер приложенийОтправка отчетов
Отладка Com0comGDBKdbgRossym.gdbRoswin.gdbWinDBGРуководство по WinDBGВключение трассировки ядраКоды DPRINTУдалённый отладчик ReactOS
Сборка CMakeRBuildФайлы RBuildАвтоматическое копирование файловСборка MINGW-w64Сборка модулейСреда сборки
Тестирование VirtualBoxVMwareQEMUHyper-VНеобходимый объём дискаПеренос файлов на виртуальный дискУстановка ReactOSУстановка драйверов
Сеть Общие папкиSambaNFS
Игры Установка DirectPlay
Обновление ReactOSЗагрузочная флешкаЧем можно помочь проектуСоздание нового пользователяЗвук и сеть в VirtualBoxСъемка и публикация видеоIRC-каналСторонние компонентыFAQReactOS как рабочая станцияReactOS и UEFI
Обзоры ОболочкаNTVDMWOWCommunity EditionИстория сайтаReactOS ServerКриптографияПО времен XP