https://reactos.org/wiki/api.php?action=feedcontributions&user=Mna.&feedformat=atomReactOS Wiki - User contributions [en]2024-03-29T13:40:28ZUser contributionsMediaWiki 1.31.7https://reactos.org/wiki/index.php?title=AMD64&diff=36485AMD642015-03-06T17:03:02Z<p>Mna.: /* Completion Status (rough estimates) */ Showstopper for AMD64 is... description added</p>
<hr />
<div>This page describes the current status of the AMD64 port of ReactOS. AMD64 refers to AMD's specifications for a 64-bit extension to the x86 instruction set. It is also known as x86-64 (and variants such as x86_64 and x64).<br />
<br />
The [http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/ ros-amd64-bringup] branch was created on {{rev|34699}} by [[User:ThePhysicist|Timo Kreuzer]].<br />
<br />
= Status =<br />
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kd/amd64/?view=log<br />
<br />
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kd64/?view=log<br />
<br />
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kdbg/amd64/?view=log<br />
<br />
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/amd64/?view=log<br />
<br />
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/amd64/?view=log<br />
<br />
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/amd64/?view=log<br />
<br />
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/amd64/?view=log<br />
<br />
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/amd64/?view=log<br />
<br />
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/amd64/?view=log<br />
<br />
* Everything builds<br />
* A bootcd is created<br />
* setupldr loads, switches the cpu to long mode, initializes hardware/memory/paging and jumps to ntoskrnl<br />
* Basic Mm initialization is done, then the system crashes<br />
* Non paged pool allocations work<br />
* Debugging with WinDbg (break points, single stepping etc) works<br />
* Enabling interrupts makes everything go nots<br />
<br />
== Completion Status (rough estimates) ==<br />
{| class="wikitable"<br />
!<br />
! completition<br />
! comment<br />
|-<br />
| freeldr || 95% || only fixes expected<br />
|-<br />
| hal || 5% || only initial work has been done, most missing is support for interrupts<br />
|-<br />
| ntoskrnl/ke || 50% || core functionality is implemented<br />
|-<br />
| ntoskrnl/mm || 10% || only a few functions are implemented, most stuff is missing<br />
|-<br />
| rtl || 60% || exception handling is missing and unwinding is incomplete<br />
|-<br />
| crt || 60% || missing stuff here and there<br />
|-<br />
| [[PSEH]] || 0% || '''Showstopper for AMD64 branch. Unimplemented: It waits for SEH support in mingw-w64 version of GCC compiler''' <br />
See also [[Building_MINGW-w64]], [[Techwiki:SEH64]]<br />
|}<br />
<br />
==Building amd64 port==<br />
Firstly, install [http://dreimer.eu/rosbe/RosBE64.7z Amd64 addon for RosBE] (taken from [http://www.reactos.org/forum/viewtopic.php?f=9&t=9082 here]), then start a 64bit RosBE session, with a custom shortcut:<br />
<br />
Normal shortcut for i386 port is:<br />
C:\Windows\System32\cmd.exe /t:0A /k "e:\RosBE\RosBE.cmd"<br />
<br />
The one for AMD64 should be:<br />
<br />
'''C:\Windows\System32\cmd.exe /t:0A /k "e:\RosBE\RosBE.cmd" amd64'''<br />
<br />
''(And for ARM: <br />
C:\Windows\System32\cmd.exe /t:0A /k "e:\RosBE\RosBE.cmd" arm <br />
)''<br />
<br />
Here "''e:\RosBE''" was install path of RosBE.<br />
<br />
Run the custom shortcut, then proceed as usual ([[Building_ReactOS|'''ninja bootcd''']] and similar).<br />
You can build amd64 and arm at the same trunk you use for x86 build. <br />
New directories will be created and the built ISO will also have different name: ''ReactOS-amd64.iso'' <br />
<br />
''(or ReactOS-arm.iso for ARM)''.<br />
<br />
== Links ==<br />
<br />
* ViewVC of [http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/ ros-amd64-bringup]<br />
* [http://www.nynaeve.net/?p=99 Nynaeve: Programming against the x64 exception handling support]<br />
<br />
==See Also==<br />
[[ReactOS_ports#AMD64_.28.22amd64.22.29|ReactOS Ports AMD64 Section]]<br />
<br />
[[Category:Development]]<br />
[[Category:amd64]]<br />
[[Category:Branches]]</div>Mna.https://reactos.org/wiki/index.php?title=AMD64&diff=36484AMD642015-03-06T17:00:45Z<p>Mna.: /* Building amd64 port */</p>
<hr />
<div>This page describes the current status of the AMD64 port of ReactOS. AMD64 refers to AMD's specifications for a 64-bit extension to the x86 instruction set. It is also known as x86-64 (and variants such as x86_64 and x64).<br />
<br />
The [http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/ ros-amd64-bringup] branch was created on {{rev|34699}} by [[User:ThePhysicist|Timo Kreuzer]].<br />
<br />
= Status =<br />
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kd/amd64/?view=log<br />
<br />
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kd64/?view=log<br />
<br />
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kdbg/amd64/?view=log<br />
<br />
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/amd64/?view=log<br />
<br />
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/amd64/?view=log<br />
<br />
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/amd64/?view=log<br />
<br />
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/amd64/?view=log<br />
<br />
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/amd64/?view=log<br />
<br />
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/amd64/?view=log<br />
<br />
* Everything builds<br />
* A bootcd is created<br />
* setupldr loads, switches the cpu to long mode, initializes hardware/memory/paging and jumps to ntoskrnl<br />
* Basic Mm initialization is done, then the system crashes<br />
* Non paged pool allocations work<br />
* Debugging with WinDbg (break points, single stepping etc) works<br />
* Enabling interrupts makes everything go nots<br />
<br />
== Completion Status (rough estimates) ==<br />
{| class="wikitable"<br />
!<br />
! completition<br />
! comment<br />
|-<br />
| freeldr || 95% || only fixes expected<br />
|-<br />
| hal || 5% || only initial work has been done, most missing is support for interrupts<br />
|-<br />
| ntoskrnl/ke || 50% || core functionality is implemented<br />
|-<br />
| ntoskrnl/mm || 10% || only a few functions are implemented, most stuff is missing<br />
|-<br />
| rtl || 60% || exception handling is missing and unwinding is incomplete<br />
|-<br />
| crt || 60% || missing stuff here and there<br />
|-<br />
| [[PSEH]] || 0% || '''Unimplemented. Waiting for mingw-w64 support''' <br />
See also [[Building_MINGW-w64]], [[Techwiki:SEH64]]<br />
|}<br />
<br />
==Building amd64 port==<br />
Firstly, install [http://dreimer.eu/rosbe/RosBE64.7z Amd64 addon for RosBE] (taken from [http://www.reactos.org/forum/viewtopic.php?f=9&t=9082 here]), then start a 64bit RosBE session, with a custom shortcut:<br />
<br />
Normal shortcut for i386 port is:<br />
C:\Windows\System32\cmd.exe /t:0A /k "e:\RosBE\RosBE.cmd"<br />
<br />
The one for AMD64 should be:<br />
<br />
'''C:\Windows\System32\cmd.exe /t:0A /k "e:\RosBE\RosBE.cmd" amd64'''<br />
<br />
''(And for ARM: <br />
C:\Windows\System32\cmd.exe /t:0A /k "e:\RosBE\RosBE.cmd" arm <br />
)''<br />
<br />
Here "''e:\RosBE''" was install path of RosBE.<br />
<br />
Run the custom shortcut, then proceed as usual ([[Building_ReactOS|'''ninja bootcd''']] and similar).<br />
You can build amd64 and arm at the same trunk you use for x86 build. <br />
New directories will be created and the built ISO will also have different name: ''ReactOS-amd64.iso'' <br />
<br />
''(or ReactOS-arm.iso for ARM)''.<br />
<br />
== Links ==<br />
<br />
* ViewVC of [http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/ ros-amd64-bringup]<br />
* [http://www.nynaeve.net/?p=99 Nynaeve: Programming against the x64 exception handling support]<br />
<br />
==See Also==<br />
[[ReactOS_ports#AMD64_.28.22amd64.22.29|ReactOS Ports AMD64 Section]]<br />
<br />
[[Category:Development]]<br />
[[Category:amd64]]<br />
[[Category:Branches]]</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna.&diff=36481User:Mna.2015-03-03T12:58:42Z<p>Mna.: /* Issues: Reported and not yet */</p>
<hr />
<div>My patches to ReactOS// My Bookmarks with useful info// Future place for Manifest-like texts.<br />
<br />
==My Patches/WIP==<br />
''(WIP = Work in Progress)''<br />
* [Done] dmesg/kmesg command in ReactOS native kernel debugger [http://jira.reactos.org/browse/CORE-5452 CORE-5452], described there.<br />
** --<br />
* [Done/not-included] dmesg.exe User-mode utility: done. but not applied (.rbuild system was broken/removed then at the moment + 3 month delay of community considering accepting my kmesg patch).<br />
* [Almost done:forming a patch] (Important thing): MMIO for serial card at kernel early-boot. <del>(MMIO serial cards doesn't work at all in ROS.)</del><br />
** Now it works but I don't know how I will test this on real hardware with [http://jira.reactos.org/browse/CORE-8062 CORE-8062] bug leaving the computer in non-working state after every restart and turn-off.<br />
* [Done] micropatch: print CPUs count and available RAM at ROS start (work related with low-memory related bug)<br />
* (..describe later..: partitions' bug, FAT32-moved-root-node, etc)<br />
* usetup.c - series: [http://jira.reactos.org/browse/CORE-7969 CORE-7969] submitted patch at 08.03.2014: will see how long it will stay not applied. (needed to retest new hanges required by multilanguage support; will do after early-Serial-MMIO)<br />
<br />
==Issues: Reported and not yet==<br />
* [http://jira.reactos.org/browse/CORE-7978 CORE-7978] - ReactOS boot code of MBR can't boot USB-HDD due to error reading sectors with int13h_ah=42h<br />
** Added there link to very good explanation how does GRUB stage1 loader work! Just an amazingly detailed description (and also even with joke in stage2!) [http://thestarman.pcministry.com/asm/mbr/GRUB.htm This] link.<br />
** Workaround: use grub-2 to load freeldr.sys<br />
** freeldr.ini also requires editing the rdisk() parameter addressing the disks:<br />
SystemPath=multi(0)disk(0)rdisk(1)partition(2)\ReactOS<br />
<br />
rdisk(1)partition(2) here means: 2nd disk, 2nd partition. (partitions are 1-counted, rdisks - 0-counted.)<br />
<br />
* [Yet old bug of 2010/11 times until now] (On my machine: AcerAspire5920g) ReactOS loading process stuck on line ...\Drivers\DISK.SYS when Disk operation mode in BIOS is set to AHCI. Changed the mode to IDE "workarounds" the problem: ntoskrnl.exe reaches the last line ...\Drivers\NDIS.SYS -- and is stuck somewhere more later -- eating 100% CPU. (//Debug-log is required)<br />
So the summary: SATA2 is not fully supported by ReactOS, forced to use IDE.<br />
<br />
* [http://jira.reactos.org/browse/CORE-8062 CORE-8062] <br />
** '''Initial note:''' Nasty bug made me thing my laptop monitor (matrix chip) or videocard goes fried with some code of reactos; Luckily it was just wrong settings somewhere there. Unhealthy bug; leaves bad mood on any tester, it needed to be corrected by any mean.<br />
** '''Postmortem update*:''' '''***TBW***'''<br />
<br />
==Bookmarks on Topics ==<br />
Interesting topics, links (Started at 2011-04-03)<br />
<br />
Here I will keep links to forum topics, wiki pages or other, that seemed to be interesting:<br />
<br />
====Development generic====<br />
* [irc://irc.freenode.net/reactos #reactos] - For general discussion and user support, most people are here<br />
* [https://reactos.org/wiki/Mumble ROS Mumble] new thing, '15-Feb<br />
* Issues of ReactOS: <br />
** [https://jira.reactos.org/issues/?jql=status%20WAS%20not%20in%20%28%22Resolved%22%2C%20%22closed%22%29%20ORDER%20BY%20priority%20DESC%2C%20updated%20DESC Open Bugs sorted by priority], <br />
** [https://jira.reactos.org/issues/?filter=12902 N Steps to the big release],<br />
** [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20ORDER%20BY%20createdDate%20DESC bugs only sorted by new],<br />
** [https://jira.reactos.org/browse/CORE-7749 Disk Partitions and USetup], [http://jira.reactos.org/issues/?filter=-4 all issues]<br />
* Jira queries language (SQL-like): [https://confluence.atlassian.com/display/JIRA052/Advanced+Searching#AdvancedSearching-fields JIRA-query fields], [https://confluence.atlassian.com/display/JIRA052/Advanced+Searching#AdvancedSearching-operators JIRA-query operators]<br />
* [[Missing ReactOS Functionality]] - major things absent of ROS from User PoV<br />
* [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20ORDER%20BY%20priority%20DESC%2C%20createdDate%20DESC Sorted by importance (''priority'' now in JIRA) bugs of ReactOS], except of resolved ones<br />
<br />
* [http://www.reactos.org/wiki/How_PnP_Works_in_ReactOS How PnP Works in ReactOS]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8459 ReactOS, how much money it requires?] - here is only the idea, to be converted to become more correct: "How many man-months?", given man-month is more like a myth, reconsider on per-project basis<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8126 HOWTO Become a Reactos Programmer?] - forum topic, could be converted to more constructive instruction<br />
* [http://dslab.epfl.ch/proj/reveng RevEng: Device Driver Reverse Engineering] from [http://www.reactos.org/forum/viewtopic.php?f=9&t=7990 here]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8206 Command-line-only Win32 from ReactOS?] The topic about full OS without GUI ("headless"?).<br />
** Resembles me idea of [http://hex.pp.ua/nt-native-applications-shell-eng.php Windows/ReactOS Native Shell]) ([http://www.reactos.org/forum/viewtopic.php?f=11&t=9092 Russian]).<br />
<br />
====Repositories: bootCD and liveCD ====<br />
* [http://iso.reactos.org/bootcd/ bootcd repository] iso.reactos.org bootcd images<br />
* [http://iso.reactos.org/livecd/ livecd repository]<br />
<br />
====Core-doc: ReactOS startup procedure described (partly) ====<br />
* How to [[Modify the final ISO image]] - good article, have also notes on how final (bootcd) CD-image is composed, its CD directory structure <br />
* [[FreeLoader]] details<br />
* [[User:Mna./FreeLoader,_bootcd_and_bootrecords#FreeLoader_freeldr_Architecture|freeldr Architecture]] and related ReactOS startup steps:<br />
* [[User:Mna./FreeLoader,_bootcd_and_bootrecords|bootcd and bootrecords]]<br />
* [http://en.wikipedia.org/wiki/Windows_NT_Startup_Process Windows NT Startup Process/Startup Sequence]<br />
* [[User:Mna./ReactOS startup process light summary]]<br />
* [[How the system Finds and Loads Drivers]]<br />
<br />
==== Building ReactOS: Hands-on ====<br />
* [[Building_Modules#List_available_ninja_targets|available ninja targets]]<br />
* [[Building_Modules#Removing_or_Updating_a_Module|Updating a module code]] -- do this when the ROS module code was changed and build system didn't notice<br />
<br />
==== Tmp: Small notes====<br />
* Strange thing become clear: Ctrl+D doesn't work in 1st stage setup<br />
* FreeLdr debug settings:<br />
<pre> BootOptions=DbgOsLoadOptions = "/NOGUIBOOT /DEBUGPORT=COM:io,0x3f8,115200n8 /DEBUGPORT=SCREEN" </pre><br />
** See also [[User:Mna./FreeLoader_freeldr_Architecture#Specifing_Boot_Options|Specifing Boot kernel Options]] ((Not confuse it with [[Boot_options#Options|Boot Options]]))<br />
<br />
====Filesystems generic====<br />
* [[File Systems]], a good page<br />
<br />
====ReactOS Registry: Editing offline====<br />
From [http://www.reactos.org/forum/viewtopic.php?t=3162 here]<br />
{| class="wikitable"<br />
|-<br />
| <br />
Editing ReactOS registry hives outside ReactOS?<br />
--2006-12<br />
<br />
> Is it possible at this moment to edit the registry hives outside the ReactOS environment?<br />
> I wanted to automate a process to load these registry hives onto the local registry, <br />
> add all my changes, unload the hives and create a new ISO.<br />
<br />
Simply change registry sources and build your own binary hives from them.<br />
<br />
by hto <br/><br />
<br />
> I guess "make" is the prefered way, there isn't any other method for creating these hives?<br /><br />
<br />
There is hive maker in tools\mkhive. You can build it with mingw32-make.exe mkhive<br />
<br />
Copy it from output-i386\tools\mkhive\mkhive.exe to (say) Windows\mkhive.exe.<br />
Then run this command:<br />
<br />
mkhive.exe boot\bootdata output-i386\livecd\reactos\system32\config boot\bootdata\livecd.inf boot\bootdata\hiveinst.inf<br />
<br />
Where output-i386\livecd\reactos\system32\config -- is output folder for hives.<br />
This is how ''make livecd'' does it.<br />
And yes, you can add your foo.inf to the end of that command.<br />
|}<br />
<br />
====NTFS====<br />
* post about [http://www.reactos.org/forum/viewtopic.php?f=9&t=8180#p71875 FUSE-lib creation attempts in ROS] in the "[http://www.reactos.org/forum/viewtopic.php?f=9&t=8180 NTFS question]" topic<br />
* (ru) [http://www.reactos.org/forum/viewtopic.php?f=11&t=8606 NTFS-3G applied to ROS], with ''unixed'' 's idea how to integrate into the '''fuse4win''' or '''dokan'''<br />
<br />
====Misc====<br />
* [http://jira.reactos.org/browse/CORE-8059 Possible solution for Intel's HDA] Audio, high-definition audio<br />
* [http://alter.org.ua/soft/win/uni_ata/ UniATA] project of Alter<br />
* [http://alter.org.ua/en/soft/win/vidcontrol/ Display Control for Windows], Alter's site; Now part of [http://alter.org.ua/en/soft/win/uictl/ UI ctl]<br />
<br />
===Serial extension card and MMIO programming===<br />
* [https://android.googlesource.com/kernel/omap/+/glass-omap-xrr02/drivers/tty/serial/8250_early.c android kernel driver tty-serial 8250_early.c] : as serial debug interface, Android can specify not only IO-ports, but also MMIO and MMIO32 addresses. The "shentek" serial card which I own, requires such communication method, it is based on Oxford chip and gives only mmio interface.<br />
* MMIO [http://en.wikipedia.org/wiki/Memory-mapped_I/O MMIO = Memory-mapped_I/O] Linux:[http://nouveau.freedesktop.org/wiki/MmioTrace/ MmioTrace Home] [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/trace/mmiotrace.txt mmiotrace doc]<br />
<br />
**'''Note: I have much info/hands-on to add here...'''<br />
<br />
===Debug prints in ROS===<br />
* [http://alter.org.ua/docs/nt_kernel/kdprint/ KdPrint/DbgPrint and OutputDebugString behavior] at Alter's site,<br />
* [http://www.codeproject.com/KB/winsdk/OutputDebugString.aspx?display=Print Mechanism of OutputDebugString - CodeProject] the ready code sample,<br />
They (articles) discuss internals and mechanism of OutputDebugString. Definitely Windows too (as unices) uses system calls to store and receive debug messages data to/from kernel debug messages buffer.<br />
<br />
** [http://www.reactos.org/wiki/Enable_kernel_tracing ROS: Enable kernel tracing]<br />
<br />
<br />
====Unix dmesg Internals Analysis====<br />
''for comparison and for creating something equivalent/analogous in ROS''<br />
Shortly:<br />
*'''Linux''' has special system call "'''syslog'''" (man 2 syslog)<br />
*'''FreeBSD''' uses its special '''sysctl''' interface to kernel along with "'''kern.msgbuf'''" parameter.<br />
<br />
'''D'''o we need special system call like Linux, or even more, the whole<br />
family of them (sysctl('*')) as in BSD?<br />
How to implement simple system call for it, now?<br />
<br />
---<br />
<br />
Detailed info for unices:<br />
<br />
'''Linux case''':<br />
* syslog(2) - read and/or clear kernel message ring buffer; set console_loglevel<br />
int syslog(int type, char *bufp, int len);<br />
* also /proc/kmsg virtual file, which when being read returns buffer contents<br />
<br />
Excerpt from "man proc":<br />
<pre><br />
/proc/kmsg<br />
This file can be used instead of the syslog(2) system<br />
call to read kernel messages. A<br />
process must have superuser privileges to read this<br />
file, and only one process should read<br />
this file. This file should not be read if a syslog<br />
process is running which uses the sys‐<br />
log(2) system call facility to log kernel messages.<br />
<br />
Information in this file is retrieved with the dmesg(1) program.<br />
</pre><br />
<br />
'''dmesg in FreeBSD''':<br />
*Parameter 'kern.msgbuf' given to sysctl(3) returns contents of kernel message buffer.<br />
*There is also 'kern.msgbuf_clear' to clean the buffer.<br />
<br />
<br />
====/*USB====<br />
These could be probably outdated in sense the USB now is in better working state.<br />
* [http://wiki.osdev.org/Main osdev.org wiki] - main page, [http://wiki.osdev.org/USB USB, the same place]<br />
* USB for NT4:<br />
** Alter's site reviews: [http://alter.org.ua/en/docs/win/nt4_usb/ en], [http://alter.org.ua/ru/docs/win/nt4_usb/ ru]<br />
** Woodheads opensource(!), GPL USB driver: [ftp://piekraste.daba.lv/pub/Service_Pack/NT_4/NT4_USB/HS/ files backed up] [http://www.geocities.com/mypublic99/index.html "Woodhead--NT4--USB" original link (dead)]<br />
** [http://nt4ref.zcm.com.au/usb.htm Windows NT 4.0 and USB] Quote: "Conclusion: I wish people would stop making comments like 'USB is not supported under NT4' - If you must comment please make it accurate, example: 'Microsoft have made the commercial decision not to provide NT4 USB support - but some manufacturers provide support for specific USB devices on NT4.'"<br />
<br />
====*/====<br />
<br />
<br />
=== FreeLoader, debug information, getting===<br />
Related with low-memory bug: 1) 4Gb was recognized as 25Mb 2) ROS started with 25Mb silently eat up 100% CPU and infinitely read from boot CD/HDD.<br />
* Debugging the FreeLdr: [http://jira.reactos.org/secure/attachment/16335/freeldr.patch freeldr.patch turning on debug mode] from [http://jira.reactos.org/browse/CORE-5462 CORE-5462] -- patch by ''rafalh''<br />
* [[FreeLoader]]<br />
<br />
Misc...<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=7915#p68991 by gabrielilardi @ 20 Jan 2010, forum of ROS]<br />
* [http://www.reactos.org/forum/viewtopic.php?p=62488#p62488 by hto @13 Jul 2009]<br />
<br />
===SVN how-to links===<br />
* [http://subversion.apache.org/faq.html] found through google [svn through proxy]<br />
* [http://www.mikepot.com/1544.html], same<br />
* SVN book: [http://svn.zen-cart.org.ua/documentation/en/book/svn-book.html Version Control with Subversion 1.2]<br />
** [http://svn.zen-cart.org.ua/documentation/ru/book/ Same SVN guide, russian]</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna.&diff=36479User:Mna.2015-03-03T12:41:03Z<p>Mna.: </p>
<hr />
<div>My patches to ReactOS// My Bookmarks with useful info// Future place for Manifest-like texts.<br />
<br />
==My Patches/WIP==<br />
''(WIP = Work in Progress)''<br />
* [Done] dmesg/kmesg command in ReactOS native kernel debugger [http://jira.reactos.org/browse/CORE-5452 CORE-5452], described there.<br />
** --<br />
* [Done/not-included] dmesg.exe User-mode utility: done. but not applied (.rbuild system was broken/removed then at the moment + 3 month delay of community considering accepting my kmesg patch).<br />
* [Almost done:forming a patch] (Important thing): MMIO for serial card at kernel early-boot. <del>(MMIO serial cards doesn't work at all in ROS.)</del><br />
** Now it works but I don't know how I will test this on real hardware with [http://jira.reactos.org/browse/CORE-8062 CORE-8062] bug leaving the computer in non-working state after every restart and turn-off.<br />
* [Done] micropatch: print CPUs count and available RAM at ROS start (work related with low-memory related bug)<br />
* (..describe later..: partitions' bug, FAT32-moved-root-node, etc)<br />
* usetup.c - series: [http://jira.reactos.org/browse/CORE-7969 CORE-7969] submitted patch at 08.03.2014: will see how long it will stay not applied. (needed to retest new hanges required by multilanguage support; will do after early-Serial-MMIO)<br />
<br />
==Issues: Reported and not yet==<br />
* [http://jira.reactos.org/browse/CORE-7978 CORE-7978] - ReactOS boot code of MBR can't boot USB-HDD due to error reading sectors with int13h_ah=42h<br />
** Added there link to very good explanation how does GRUB stage1 loader work! Just an amazingly detailed description (and also even with joke in stage2!) [http://thestarman.pcministry.com/asm/mbr/GRUB.htm This] link.<br />
** Workaround: use grub-2 to load freeldr.sys<br />
** freeldr.ini also requires editing the rdisk() parameter addressing the disks:<br />
SystemPath=multi(0)disk(0)rdisk(1)partition(2)\ReactOS<br />
<br />
rdisk(1)partition(2) here means: 2nd disk, 2nd partition. (partitions are 1-counted, rdisks - 0-counted.)<br />
<br />
* [Yet old bug of 2010/11 times until now] (On my machine: AcerAspire5920g) ReactOS loading process stuck on line ...\Drivers\DISK.SYS when Disk operation mode in BIOS is set to AHCI. Changed the mode to IDE "workarounds" the problem: ntoskrnl.exe reaches the last line ...\Drivers\NDIS.SYS -- and is stuck somewhere more later -- eating 100% CPU. (//Debug-log is required)<br />
So the summary: SATA2 is not fully supported by ReactOS, forced to use IDE.<br />
<br />
* [http://jira.reactos.org/browse/CORE-8062 CORE-8062] Nasty bug made me thing my laptop monitor (matrix chip) or videocard goes fried with some code of reactos; Luckily it was just wrong settings somewhere there. Unhealthy bug; leaves bad mood on any tester, it needed to be corrected by any mean.<br />
<br />
==Bookmarks on Topics ==<br />
Interesting topics, links (Started at 2011-04-03)<br />
<br />
Here I will keep links to forum topics, wiki pages or other, that seemed to be interesting:<br />
<br />
====Development generic====<br />
* [irc://irc.freenode.net/reactos #reactos] - For general discussion and user support, most people are here<br />
* [https://reactos.org/wiki/Mumble ROS Mumble] new thing, '15-Feb<br />
* Issues of ReactOS: <br />
** [https://jira.reactos.org/issues/?jql=status%20WAS%20not%20in%20%28%22Resolved%22%2C%20%22closed%22%29%20ORDER%20BY%20priority%20DESC%2C%20updated%20DESC Open Bugs sorted by priority], <br />
** [https://jira.reactos.org/issues/?filter=12902 N Steps to the big release],<br />
** [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20ORDER%20BY%20createdDate%20DESC bugs only sorted by new],<br />
** [https://jira.reactos.org/browse/CORE-7749 Disk Partitions and USetup], [http://jira.reactos.org/issues/?filter=-4 all issues]<br />
* Jira queries language (SQL-like): [https://confluence.atlassian.com/display/JIRA052/Advanced+Searching#AdvancedSearching-fields JIRA-query fields], [https://confluence.atlassian.com/display/JIRA052/Advanced+Searching#AdvancedSearching-operators JIRA-query operators]<br />
* [[Missing ReactOS Functionality]] - major things absent of ROS from User PoV<br />
* [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20ORDER%20BY%20priority%20DESC%2C%20createdDate%20DESC Sorted by importance (''priority'' now in JIRA) bugs of ReactOS], except of resolved ones<br />
<br />
* [http://www.reactos.org/wiki/How_PnP_Works_in_ReactOS How PnP Works in ReactOS]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8459 ReactOS, how much money it requires?] - here is only the idea, to be converted to become more correct: "How many man-months?", given man-month is more like a myth, reconsider on per-project basis<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8126 HOWTO Become a Reactos Programmer?] - forum topic, could be converted to more constructive instruction<br />
* [http://dslab.epfl.ch/proj/reveng RevEng: Device Driver Reverse Engineering] from [http://www.reactos.org/forum/viewtopic.php?f=9&t=7990 here]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8206 Command-line-only Win32 from ReactOS?] The topic about full OS without GUI ("headless"?).<br />
** Resembles me idea of [http://hex.pp.ua/nt-native-applications-shell-eng.php Windows/ReactOS Native Shell]) ([http://www.reactos.org/forum/viewtopic.php?f=11&t=9092 Russian]).<br />
<br />
====Repositories: bootCD and liveCD ====<br />
* [http://iso.reactos.org/bootcd/ bootcd repository] iso.reactos.org bootcd images<br />
* [http://iso.reactos.org/livecd/ livecd repository]<br />
<br />
====Core-doc: ReactOS startup procedure described (partly) ====<br />
* How to [[Modify the final ISO image]] - good article, have also notes on how final (bootcd) CD-image is composed, its CD directory structure <br />
* [[FreeLoader]] details<br />
* [[User:Mna./FreeLoader,_bootcd_and_bootrecords#FreeLoader_freeldr_Architecture|freeldr Architecture]] and related ReactOS startup steps:<br />
* [[User:Mna./FreeLoader,_bootcd_and_bootrecords|bootcd and bootrecords]]<br />
* [http://en.wikipedia.org/wiki/Windows_NT_Startup_Process Windows NT Startup Process/Startup Sequence]<br />
* [[User:Mna./ReactOS startup process light summary]]<br />
* [[How the system Finds and Loads Drivers]]<br />
<br />
==== Building ReactOS: Hands-on ====<br />
* [[Building_Modules#List_available_ninja_targets|available ninja targets]]<br />
* [[Building_Modules#Removing_or_Updating_a_Module|Updating a module code]] -- do this when the ROS module code was changed and build system didn't notice<br />
<br />
==== Tmp: Small notes====<br />
* Strange thing become clear: Ctrl+D doesn't work in 1st stage setup<br />
* FreeLdr debug settings:<br />
<pre> BootOptions=DbgOsLoadOptions = "/NOGUIBOOT /DEBUGPORT=COM:io,0x3f8,115200n8 /DEBUGPORT=SCREEN" </pre><br />
** See also [[User:Mna./FreeLoader_freeldr_Architecture#Specifing_Boot_Options|Specifing Boot kernel Options]] ((Not confuse it with [[Boot_options#Options|Boot Options]]))<br />
<br />
====Filesystems generic====<br />
* [[File Systems]], a good page<br />
<br />
====ReactOS Registry: Editing offline====<br />
From [http://www.reactos.org/forum/viewtopic.php?t=3162 here]<br />
{| class="wikitable"<br />
|-<br />
| <br />
Editing ReactOS registry hives outside ReactOS?<br />
--2006-12<br />
<br />
> Is it possible at this moment to edit the registry hives outside the ReactOS environment?<br />
> I wanted to automate a process to load these registry hives onto the local registry, <br />
> add all my changes, unload the hives and create a new ISO.<br />
<br />
Simply change registry sources and build your own binary hives from them.<br />
<br />
by hto <br/><br />
<br />
> I guess "make" is the prefered way, there isn't any other method for creating these hives?<br /><br />
<br />
There is hive maker in tools\mkhive. You can build it with mingw32-make.exe mkhive<br />
<br />
Copy it from output-i386\tools\mkhive\mkhive.exe to (say) Windows\mkhive.exe.<br />
Then run this command:<br />
<br />
mkhive.exe boot\bootdata output-i386\livecd\reactos\system32\config boot\bootdata\livecd.inf boot\bootdata\hiveinst.inf<br />
<br />
Where output-i386\livecd\reactos\system32\config -- is output folder for hives.<br />
This is how ''make livecd'' does it.<br />
And yes, you can add your foo.inf to the end of that command.<br />
|}<br />
<br />
====NTFS====<br />
* post about [http://www.reactos.org/forum/viewtopic.php?f=9&t=8180#p71875 FUSE-lib creation attempts in ROS] in the "[http://www.reactos.org/forum/viewtopic.php?f=9&t=8180 NTFS question]" topic<br />
* (ru) [http://www.reactos.org/forum/viewtopic.php?f=11&t=8606 NTFS-3G applied to ROS], with ''unixed'' 's idea how to integrate into the '''fuse4win''' or '''dokan'''<br />
<br />
====Misc====<br />
* [http://jira.reactos.org/browse/CORE-8059 Possible solution for Intel's HDA] Audio, high-definition audio<br />
* [http://alter.org.ua/soft/win/uni_ata/ UniATA] project of Alter<br />
* [http://alter.org.ua/en/soft/win/vidcontrol/ Display Control for Windows], Alter's site; Now part of [http://alter.org.ua/en/soft/win/uictl/ UI ctl]<br />
<br />
===Serial extension card and MMIO programming===<br />
* [https://android.googlesource.com/kernel/omap/+/glass-omap-xrr02/drivers/tty/serial/8250_early.c android kernel driver tty-serial 8250_early.c] : as serial debug interface, Android can specify not only IO-ports, but also MMIO and MMIO32 addresses. The "shentek" serial card which I own, requires such communication method, it is based on Oxford chip and gives only mmio interface.<br />
* MMIO [http://en.wikipedia.org/wiki/Memory-mapped_I/O MMIO = Memory-mapped_I/O] Linux:[http://nouveau.freedesktop.org/wiki/MmioTrace/ MmioTrace Home] [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/trace/mmiotrace.txt mmiotrace doc]<br />
<br />
**'''Note: I have much info/hands-on to add here...'''<br />
<br />
===Debug prints in ROS===<br />
* [http://alter.org.ua/docs/nt_kernel/kdprint/ KdPrint/DbgPrint and OutputDebugString behavior] at Alter's site,<br />
* [http://www.codeproject.com/KB/winsdk/OutputDebugString.aspx?display=Print Mechanism of OutputDebugString - CodeProject] the ready code sample,<br />
They (articles) discuss internals and mechanism of OutputDebugString. Definitely Windows too (as unices) uses system calls to store and receive debug messages data to/from kernel debug messages buffer.<br />
<br />
** [http://www.reactos.org/wiki/Enable_kernel_tracing ROS: Enable kernel tracing]<br />
<br />
<br />
====Unix dmesg Internals Analysis====<br />
''for comparison and for creating something equivalent/analogous in ROS''<br />
Shortly:<br />
*'''Linux''' has special system call "'''syslog'''" (man 2 syslog)<br />
*'''FreeBSD''' uses its special '''sysctl''' interface to kernel along with "'''kern.msgbuf'''" parameter.<br />
<br />
'''D'''o we need special system call like Linux, or even more, the whole<br />
family of them (sysctl('*')) as in BSD?<br />
How to implement simple system call for it, now?<br />
<br />
---<br />
<br />
Detailed info for unices:<br />
<br />
'''Linux case''':<br />
* syslog(2) - read and/or clear kernel message ring buffer; set console_loglevel<br />
int syslog(int type, char *bufp, int len);<br />
* also /proc/kmsg virtual file, which when being read returns buffer contents<br />
<br />
Excerpt from "man proc":<br />
<pre><br />
/proc/kmsg<br />
This file can be used instead of the syslog(2) system<br />
call to read kernel messages. A<br />
process must have superuser privileges to read this<br />
file, and only one process should read<br />
this file. This file should not be read if a syslog<br />
process is running which uses the sys‐<br />
log(2) system call facility to log kernel messages.<br />
<br />
Information in this file is retrieved with the dmesg(1) program.<br />
</pre><br />
<br />
'''dmesg in FreeBSD''':<br />
*Parameter 'kern.msgbuf' given to sysctl(3) returns contents of kernel message buffer.<br />
*There is also 'kern.msgbuf_clear' to clean the buffer.<br />
<br />
<br />
====/*USB====<br />
These could be probably outdated in sense the USB now is in better working state.<br />
* [http://wiki.osdev.org/Main osdev.org wiki] - main page, [http://wiki.osdev.org/USB USB, the same place]<br />
* USB for NT4:<br />
** Alter's site reviews: [http://alter.org.ua/en/docs/win/nt4_usb/ en], [http://alter.org.ua/ru/docs/win/nt4_usb/ ru]<br />
** Woodheads opensource(!), GPL USB driver: [ftp://piekraste.daba.lv/pub/Service_Pack/NT_4/NT4_USB/HS/ files backed up] [http://www.geocities.com/mypublic99/index.html "Woodhead--NT4--USB" original link (dead)]<br />
** [http://nt4ref.zcm.com.au/usb.htm Windows NT 4.0 and USB] Quote: "Conclusion: I wish people would stop making comments like 'USB is not supported under NT4' - If you must comment please make it accurate, example: 'Microsoft have made the commercial decision not to provide NT4 USB support - but some manufacturers provide support for specific USB devices on NT4.'"<br />
<br />
====*/====<br />
<br />
<br />
=== FreeLoader, debug information, getting===<br />
Related with low-memory bug: 1) 4Gb was recognized as 25Mb 2) ROS started with 25Mb silently eat up 100% CPU and infinitely read from boot CD/HDD.<br />
* Debugging the FreeLdr: [http://jira.reactos.org/secure/attachment/16335/freeldr.patch freeldr.patch turning on debug mode] from [http://jira.reactos.org/browse/CORE-5462 CORE-5462] -- patch by ''rafalh''<br />
* [[FreeLoader]]<br />
<br />
Misc...<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=7915#p68991 by gabrielilardi @ 20 Jan 2010, forum of ROS]<br />
* [http://www.reactos.org/forum/viewtopic.php?p=62488#p62488 by hto @13 Jul 2009]<br />
<br />
===SVN how-to links===<br />
* [http://subversion.apache.org/faq.html] found through google [svn through proxy]<br />
* [http://www.mikepot.com/1544.html], same<br />
* SVN book: [http://svn.zen-cart.org.ua/documentation/en/book/svn-book.html Version Control with Subversion 1.2]<br />
** [http://svn.zen-cart.org.ua/documentation/ru/book/ Same SVN guide, russian]</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna.&diff=36478User:Mna.2015-03-03T12:29:41Z<p>Mna.: /* (Generic) Development */</p>
<hr />
<div>My patches to ReactOS// My Bookmarks with useful info// Future place for Manifest-like texts.<br />
<br />
==My Patches/WIP==<br />
''(WIP = Work in Progress)''<br />
* [Done] dmesg/kmesg command in ReactOS native kernel debugger [http://jira.reactos.org/browse/CORE-5452 CORE-5452], described there.<br />
** --<br />
* [Done/not-included] dmesg.exe User-mode utility: done. but not applied (.rbuild system was broken/removed then at the moment + 3 month delay of community considering accepting my kmesg patch).<br />
* [Almost done:forming a patch] (Important thing): MMIO for serial card at kernel early-boot. <del>(MMIO serial cards doesn't work at all in ROS.)</del><br />
** Now it works but I don't know how I will test this on real hardware with [http://jira.reactos.org/browse/CORE-8062 CORE-8062] bug leaving the computer in non-working state after every restart and turn-off.<br />
* [Done] micropatch: print CPUs count and available RAM at ROS start (work related with low-memory related bug)<br />
* (..describe later..: partitions' bug, FAT32-moved-root-node, etc)<br />
* usetup.c - series: [http://jira.reactos.org/browse/CORE-7969 CORE-7969] submitted patch at 08.03.2014: will see how long it will stay not applied. (needed to retest new hanges required by multilanguage support; will do after early-Serial-MMIO)<br />
<br />
==Issues: Reported and not yet==<br />
* [http://jira.reactos.org/browse/CORE-7978 CORE-7978] - ReactOS boot code of MBR can't boot USB-HDD due to error reading sectors with int13h_ah=42h<br />
** Added there link to very good explanation how does GRUB stage1 loader work! Just an amazingly detailed description (and also even with joke in stage2!) [http://thestarman.pcministry.com/asm/mbr/GRUB.htm This] link.<br />
** Workaround: use grub-2 to load freeldr.sys<br />
** freeldr.ini also requires editing the rdisk() parameter addressing the disks:<br />
SystemPath=multi(0)disk(0)rdisk(1)partition(2)\ReactOS<br />
<br />
rdisk(1)partition(2) here means: 2nd disk, 2nd partition. (partitions are 1-counted, rdisks - 0-counted.)<br />
<br />
* [Yet old bug of 2010/11 times until now] (On my machine: AcerAspire5920g) ReactOS loading process stuck on line ...\Drivers\DISK.SYS when Disk operation mode in BIOS is set to AHCI. Changed the mode to IDE "workarounds" the problem: ntoskrnl.exe reaches the last line ...\Drivers\NDIS.SYS -- and is stuck somewhere more later -- eating 100% CPU. (//Debug-log is required)<br />
So the summary: SATA2 is not fully supported by ReactOS, forced to use IDE.<br />
<br />
* [http://jira.reactos.org/browse/CORE-8062 CORE-8062] Nasty bug made me thing my laptop monitor (matrix chip) or videocard goes fried with some code of reactos; Luckily it was just wrong settings somewhere there. Unhealthy bug; leaves bad mood on any tester, it needed to be corrected by any mean.<br />
<br />
==Bookmarks on Topics ==<br />
Interesting topics, links (Started at 2011-04-03)<br />
<br />
Here I will keep links to forum topics, wiki pages or other, that seemed to be interesting:<br />
<br />
====Development generic====<br />
* [irc://irc.freenode.net/reactos #reactos] - For general discussion and user support, most people are here<br />
* [https://reactos.org/wiki/Mumble ROS Mumble] new thing, '15-Feb<br />
* Issues of ReactOS: <br />
** [https://jira.reactos.org/issues/?jql=status%20WAS%20not%20in%20%28%22Resolved%22%2C%20%22closed%22%29%20ORDER%20BY%20priority%20DESC%2C%20updated%20DESC Open Bugs sorted by priority], <br />
** [https://jira.reactos.org/issues/?filter=12902 N Steps to the big release],<br />
** [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20ORDER%20BY%20createdDate%20DESC bugs only sorted by new],<br />
** [https://jira.reactos.org/browse/CORE-7749 Disk Partitions and USetup], [http://jira.reactos.org/issues/?filter=-4 all issues]<br />
* Jira queries language (SQL-like): [https://confluence.atlassian.com/display/JIRA052/Advanced+Searching#AdvancedSearching-fields JIRA-query fields], [https://confluence.atlassian.com/display/JIRA052/Advanced+Searching#AdvancedSearching-operators JIRA-query operators]<br />
* [[Missing ReactOS Functionality]] - major things absent of ROS from User PoV<br />
* [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20ORDER%20BY%20priority%20DESC%2C%20createdDate%20DESC Sorted by importance (''priority'' now in JIRA) bugs of ReactOS], except of resolved ones<br />
<br />
* [http://www.reactos.org/wiki/How_PnP_Works_in_ReactOS How PnP Works in ReactOS]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8459 ReactOS, how much money it requires?] - here is only the idea, to be converted to become more correct: "How many man-months?", given man-month is more like a myth, reconsider on per-project basis<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8126 HOWTO Become a Reactos Programmer?] - forum topic, could be converted to more constructive instruction<br />
* [http://dslab.epfl.ch/proj/reveng RevEng: Device Driver Reverse Engineering] from [http://www.reactos.org/forum/viewtopic.php?f=9&t=7990 here]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8206 Command-line-only Win32 from ReactOS?] The topic about full OS without GUI ("headless"?).<br />
** Resembles me idea of [http://hex.pp.ua/nt-native-applications-shell-eng.php Windows/ReactOS Native Shell]) ([http://www.reactos.org/forum/viewtopic.php?f=11&t=9092 Russian]).<br />
<br />
====bootCD and liveCD repositories====<br />
* [http://iso.reactos.org/bootcd/ bootcd repository] iso.reactos.org bootcd images<br />
* [http://iso.reactos.org/livecd/ livecd repository]<br />
<br />
====ReactOS startup procedure described (partly) ====<br />
* [[Modify the final ISO image]] - good article, have also notes on how (bootcd) final CD-image is composed -- i.e. CD directory structure <br />
* [[FreeLoader]] details<br />
* [[User:Mna./FreeLoader,_bootcd_and_bootrecords#FreeLoader_freeldr_Architecture|freeldr Architecture]] and related ReactOS startup steps:<br />
* [[User:Mna./FreeLoader,_bootcd_and_bootrecords|bootcd and bootrecords]]<br />
* [http://en.wikipedia.org/wiki/Windows_NT_Startup_Process Windows NT Startup Process/ Sequence]<br />
* [[User:Mna./ReactOS startup process light summary]]<br />
* [[How the system Finds and Loads Drivers]]<br />
<br />
==== ROS build system hands-on ====<br />
* [[Building_Modules#List_available_ninja_targets|available ninja targets]]<br />
* [[Building_Modules#Removing_or_Updating_a_Module|Updating a module code]] -- do this when the ROS module code was changed and build system didn't notice<br />
* Strange thing become clear; Ctrl+D doesn't work in 1st stage setup.<br />
BootOptions=DbgOsLoadOptions = "/NOGUIBOOT /DEBUGPORT=COM:io,0x3f8,115200n8 /DEBUGPORT=SCREEN" See also [[User:Mna./FreeLoader_freeldr_Architecture#Specifing_Boot_Options|Specifing Boot kernel Options]] ((Not confuse it with [[Boot_options#Options|Boot Options]]))<br />
<br />
====Filesystems generic====<br />
* [[File Systems]], a good page<br />
<br />
====Editing ReactOS registry offline====<br />
From [http://www.reactos.org/forum/viewtopic.php?t=3162 here]<br />
{| class="wikitable"<br />
|-<br />
| <br />
Editing ReactOS registry hives outside ReactOS?<br />
--2006-12<br />
<br />
> Is it possible at this moment to edit the registry hives outside the ReactOS environment?<br />
> I wanted to automate a process to load these registry hives onto the local registry, <br />
> add all my changes, unload the hives and create a new ISO.<br />
<br />
Simply change registry sources and build your own binary hives from them.<br />
<br />
by hto <br/><br />
<br />
> I guess "make" is the prefered way, there isn't any other method for creating these hives?<br /><br />
<br />
There is hive maker in tools\mkhive. You can build it with mingw32-make.exe mkhive<br />
<br />
Copy it from output-i386\tools\mkhive\mkhive.exe to (say) Windows\mkhive.exe.<br />
Then run this command:<br />
<br />
mkhive.exe boot\bootdata output-i386\livecd\reactos\system32\config boot\bootdata\livecd.inf boot\bootdata\hiveinst.inf<br />
<br />
Where output-i386\livecd\reactos\system32\config -- is output folder for hives.<br />
This is how ''make livecd'' does it.<br />
And yes, you can add your foo.inf to the end of that command.<br />
|}<br />
<br />
====NTFS====<br />
* post about [http://www.reactos.org/forum/viewtopic.php?f=9&t=8180#p71875 FUSE-lib creation attempts in ROS] in the "[http://www.reactos.org/forum/viewtopic.php?f=9&t=8180 NTFS question]" topic<br />
* (ru) [http://www.reactos.org/forum/viewtopic.php?f=11&t=8606 NTFS-3G applied to ROS], with ''unixed'' 's idea how to integrate into the '''fuse4win''' or '''dokan'''<br />
<br />
====Misc====<br />
* [http://jira.reactos.org/browse/CORE-8059 Possible solution for Intel's HDA] Audio, high-definition audio<br />
* [http://alter.org.ua/soft/win/uni_ata/ UniATA] project of Alter<br />
* [http://alter.org.ua/en/soft/win/vidcontrol/ Display Control for Windows], Alter's site; Now part of [http://alter.org.ua/en/soft/win/uictl/ UI ctl]<br />
<br />
===Serial extension card and MMIO programming===<br />
* [https://android.googlesource.com/kernel/omap/+/glass-omap-xrr02/drivers/tty/serial/8250_early.c android kernel driver tty-serial 8250_early.c] : as serial debug interface, Android can specify not only IO-ports, but also MMIO and MMIO32 addresses. The "shentek" serial card which I own, requires such communication method, it is based on Oxford chip and gives only mmio interface.<br />
* MMIO [http://en.wikipedia.org/wiki/Memory-mapped_I/O MMIO = Memory-mapped_I/O] Linux:[http://nouveau.freedesktop.org/wiki/MmioTrace/ MmioTrace Home] [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/trace/mmiotrace.txt mmiotrace doc]<br />
<br />
**'''Note: I have much info/hands-on to add here...'''<br />
<br />
===Debug prints in ROS===<br />
* [http://alter.org.ua/docs/nt_kernel/kdprint/ KdPrint/DbgPrint and OutputDebugString behavior] at Alter's site,<br />
* [http://www.codeproject.com/KB/winsdk/OutputDebugString.aspx?display=Print Mechanism of OutputDebugString - CodeProject] the ready code sample,<br />
They (articles) discuss internals and mechanism of OutputDebugString. Definitely Windows too (as unices) uses system calls to store and receive debug messages data to/from kernel debug messages buffer.<br />
<br />
** [http://www.reactos.org/wiki/Enable_kernel_tracing ROS: Enable kernel tracing]<br />
<br />
<br />
====Unix dmesg Internals Analysis====<br />
''for comparison and for creating something equivalent/analogous in ROS''<br />
Shortly:<br />
*'''Linux''' has special system call "'''syslog'''" (man 2 syslog)<br />
*'''FreeBSD''' uses its special '''sysctl''' interface to kernel along with "'''kern.msgbuf'''" parameter.<br />
<br />
'''D'''o we need special system call like Linux, or even more, the whole<br />
family of them (sysctl('*')) as in BSD?<br />
How to implement simple system call for it, now?<br />
<br />
---<br />
<br />
Detailed info for unices:<br />
<br />
'''Linux case''':<br />
* syslog(2) - read and/or clear kernel message ring buffer; set console_loglevel<br />
int syslog(int type, char *bufp, int len);<br />
* also /proc/kmsg virtual file, which when being read returns buffer contents<br />
<br />
Excerpt from "man proc":<br />
<pre><br />
/proc/kmsg<br />
This file can be used instead of the syslog(2) system<br />
call to read kernel messages. A<br />
process must have superuser privileges to read this<br />
file, and only one process should read<br />
this file. This file should not be read if a syslog<br />
process is running which uses the sys‐<br />
log(2) system call facility to log kernel messages.<br />
<br />
Information in this file is retrieved with the dmesg(1) program.<br />
</pre><br />
<br />
'''dmesg in FreeBSD''':<br />
*Parameter 'kern.msgbuf' given to sysctl(3) returns contents of kernel message buffer.<br />
*There is also 'kern.msgbuf_clear' to clean the buffer.<br />
<br />
<br />
====/*USB====<br />
These could be probably outdated in sense the USB now is in better working state.<br />
* [http://wiki.osdev.org/Main osdev.org wiki] - main page, [http://wiki.osdev.org/USB USB, the same place]<br />
* USB for NT4:<br />
** Alter's site reviews: [http://alter.org.ua/en/docs/win/nt4_usb/ en], [http://alter.org.ua/ru/docs/win/nt4_usb/ ru]<br />
** Woodheads opensource(!), GPL USB driver: [ftp://piekraste.daba.lv/pub/Service_Pack/NT_4/NT4_USB/HS/ files backed up] [http://www.geocities.com/mypublic99/index.html "Woodhead--NT4--USB" original link (dead)]<br />
** [http://nt4ref.zcm.com.au/usb.htm Windows NT 4.0 and USB] Quote: "Conclusion: I wish people would stop making comments like 'USB is not supported under NT4' - If you must comment please make it accurate, example: 'Microsoft have made the commercial decision not to provide NT4 USB support - but some manufacturers provide support for specific USB devices on NT4.'"<br />
<br />
====*/====<br />
<br />
<br />
=== FreeLoader, debug information, getting===<br />
Related with low-memory bug: 1) 4Gb was recognized as 25Mb 2) ROS started with 25Mb silently eat up 100% CPU and infinitely read from boot CD/HDD.<br />
* Debugging the FreeLdr: [http://jira.reactos.org/secure/attachment/16335/freeldr.patch freeldr.patch turning on debug mode] from [http://jira.reactos.org/browse/CORE-5462 CORE-5462] -- patch by ''rafalh''<br />
* [[FreeLoader]]<br />
<br />
Misc...<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=7915#p68991 by gabrielilardi @ 20 Jan 2010, forum of ROS]<br />
* [http://www.reactos.org/forum/viewtopic.php?p=62488#p62488 by hto @13 Jul 2009]<br />
<br />
===SVN how-to links===<br />
* [http://subversion.apache.org/faq.html] found through google [svn through proxy]<br />
* [http://www.mikepot.com/1544.html], same<br />
* SVN book: [http://svn.zen-cart.org.ua/documentation/en/book/svn-book.html Version Control with Subversion 1.2]<br />
** [http://svn.zen-cart.org.ua/documentation/ru/book/ Same SVN guide, russian]</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna.&diff=36477User:Mna.2015-03-03T12:24:20Z<p>Mna.: /* (Generic) Development */ added link: N Steps to the big release</p>
<hr />
<div>My patches to ReactOS// My Bookmarks with useful info// Future place for Manifest-like texts.<br />
<br />
==My Patches/WIP==<br />
''(WIP = Work in Progress)''<br />
* [Done] dmesg/kmesg command in ReactOS native kernel debugger [http://jira.reactos.org/browse/CORE-5452 CORE-5452], described there.<br />
** --<br />
* [Done/not-included] dmesg.exe User-mode utility: done. but not applied (.rbuild system was broken/removed then at the moment + 3 month delay of community considering accepting my kmesg patch).<br />
* [Almost done:forming a patch] (Important thing): MMIO for serial card at kernel early-boot. <del>(MMIO serial cards doesn't work at all in ROS.)</del><br />
** Now it works but I don't know how I will test this on real hardware with [http://jira.reactos.org/browse/CORE-8062 CORE-8062] bug leaving the computer in non-working state after every restart and turn-off.<br />
* [Done] micropatch: print CPUs count and available RAM at ROS start (work related with low-memory related bug)<br />
* (..describe later..: partitions' bug, FAT32-moved-root-node, etc)<br />
* usetup.c - series: [http://jira.reactos.org/browse/CORE-7969 CORE-7969] submitted patch at 08.03.2014: will see how long it will stay not applied. (needed to retest new hanges required by multilanguage support; will do after early-Serial-MMIO)<br />
<br />
==Issues: Reported and not yet==<br />
* [http://jira.reactos.org/browse/CORE-7978 CORE-7978] - ReactOS boot code of MBR can't boot USB-HDD due to error reading sectors with int13h_ah=42h<br />
** Added there link to very good explanation how does GRUB stage1 loader work! Just an amazingly detailed description (and also even with joke in stage2!) [http://thestarman.pcministry.com/asm/mbr/GRUB.htm This] link.<br />
** Workaround: use grub-2 to load freeldr.sys<br />
** freeldr.ini also requires editing the rdisk() parameter addressing the disks:<br />
SystemPath=multi(0)disk(0)rdisk(1)partition(2)\ReactOS<br />
<br />
rdisk(1)partition(2) here means: 2nd disk, 2nd partition. (partitions are 1-counted, rdisks - 0-counted.)<br />
<br />
* [Yet old bug of 2010/11 times until now] (On my machine: AcerAspire5920g) ReactOS loading process stuck on line ...\Drivers\DISK.SYS when Disk operation mode in BIOS is set to AHCI. Changed the mode to IDE "workarounds" the problem: ntoskrnl.exe reaches the last line ...\Drivers\NDIS.SYS -- and is stuck somewhere more later -- eating 100% CPU. (//Debug-log is required)<br />
So the summary: SATA2 is not fully supported by ReactOS, forced to use IDE.<br />
<br />
* [http://jira.reactos.org/browse/CORE-8062 CORE-8062] Nasty bug made me thing my laptop monitor (matrix chip) or videocard goes fried with some code of reactos; Luckily it was just wrong settings somewhere there. Unhealthy bug; leaves bad mood on any tester, it needed to be corrected by any mean.<br />
<br />
==Bookmarks on Topics ==<br />
Interesting topics, links (Started at 2011-04-03)<br />
<br />
Here I will keep links to forum topics, wiki pages or other, that seemed to be interesting:<br />
<br />
====(Generic) Development====<br />
* [irc://irc.freenode.net/reactos #reactos] - For general discussion and user support, most people are here<br />
* [https://reactos.org/wiki/Mumble ROS Mumble] new thing, '15-Feb<br />
* Issues of ReactOS: <br />
** [https://jira.reactos.org/issues/?jql=status%20WAS%20not%20in%20%28%22Resolved%22%2C%20%22closed%22%29%20ORDER%20BY%20priority%20DESC%2C%20updated%20DESC Open Bugs sorted by priority], <br />
** [https://jira.reactos.org/issues/?filter=12902 N Steps to the big release],<br />
** [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20ORDER%20BY%20createdDate%20DESC bugs only sorted by new],<br />
** [https://jira.reactos.org/browse/CORE-7749 Disk Partitions and USetup], [http://jira.reactos.org/issues/?filter=-4 all issues]<br />
* Jira queries language (SQL-like): [https://confluence.atlassian.com/display/JIRA052/Advanced+Searching#AdvancedSearching-fields JIRA-query fields], [https://confluence.atlassian.com/display/JIRA052/Advanced+Searching#AdvancedSearching-operators JIRA-query operators]<br />
* [[Missing ReactOS Functionality]] - major things absent of ROS from User PoV<br />
* [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20ORDER%20BY%20priority%20DESC%2C%20createdDate%20DESC Sorted by importance (''priority'' now in JIRA) bugs of ReactOS], except of resolved ones<br />
<br />
* [http://www.reactos.org/wiki/How_PnP_Works_in_ReactOS How PnP Works in ReactOS]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8459 ReactOS, how much money it requires?] - here is only the idea, to be converted to become more correct: "How many man-months?", given man-month is more like a myth, reconsider on per-project basis<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8126 HOWTO Become a Reactos Programmer?] - forum topic, could be converted to more constructive instruction<br />
* [http://dslab.epfl.ch/proj/reveng RevEng: Device Driver Reverse Engineering] from [http://www.reactos.org/forum/viewtopic.php?f=9&t=7990 here]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8206 Command-line-only Win32 from ReactOS?] The topic about full OS without GUI ("headless"?).<br />
** Resembles me idea of [http://hex.pp.ua/nt-native-applications-shell-eng.php Windows/ReactOS Native Shell]) ([http://www.reactos.org/forum/viewtopic.php?f=11&t=9092 Russian]).<br />
<br />
====bootCD and liveCD repositories====<br />
* [http://iso.reactos.org/bootcd/ bootcd repository] iso.reactos.org bootcd images<br />
* [http://iso.reactos.org/livecd/ livecd repository]<br />
<br />
====ReactOS startup procedure described (partly) ====<br />
* [[Modify the final ISO image]] - good article, have also notes on how (bootcd) final CD-image is composed -- i.e. CD directory structure <br />
* [[FreeLoader]] details<br />
* [[User:Mna./FreeLoader,_bootcd_and_bootrecords#FreeLoader_freeldr_Architecture|freeldr Architecture]] and related ReactOS startup steps:<br />
* [[User:Mna./FreeLoader,_bootcd_and_bootrecords|bootcd and bootrecords]]<br />
* [http://en.wikipedia.org/wiki/Windows_NT_Startup_Process Windows NT Startup Process/ Sequence]<br />
* [[User:Mna./ReactOS startup process light summary]]<br />
* [[How the system Finds and Loads Drivers]]<br />
<br />
==== ROS build system hands-on ====<br />
* [[Building_Modules#List_available_ninja_targets|available ninja targets]]<br />
* [[Building_Modules#Removing_or_Updating_a_Module|Updating a module code]] -- do this when the ROS module code was changed and build system didn't notice<br />
* Strange thing become clear; Ctrl+D doesn't work in 1st stage setup.<br />
BootOptions=DbgOsLoadOptions = "/NOGUIBOOT /DEBUGPORT=COM:io,0x3f8,115200n8 /DEBUGPORT=SCREEN" See also [[User:Mna./FreeLoader_freeldr_Architecture#Specifing_Boot_Options|Specifing Boot kernel Options]] ((Not confuse it with [[Boot_options#Options|Boot Options]]))<br />
<br />
====Filesystems generic====<br />
* [[File Systems]], a good page<br />
<br />
====Editing ReactOS registry offline====<br />
From [http://www.reactos.org/forum/viewtopic.php?t=3162 here]<br />
{| class="wikitable"<br />
|-<br />
| <br />
Editing ReactOS registry hives outside ReactOS?<br />
--2006-12<br />
<br />
> Is it possible at this moment to edit the registry hives outside the ReactOS environment?<br />
> I wanted to automate a process to load these registry hives onto the local registry, <br />
> add all my changes, unload the hives and create a new ISO.<br />
<br />
Simply change registry sources and build your own binary hives from them.<br />
<br />
by hto <br/><br />
<br />
> I guess "make" is the prefered way, there isn't any other method for creating these hives?<br /><br />
<br />
There is hive maker in tools\mkhive. You can build it with mingw32-make.exe mkhive<br />
<br />
Copy it from output-i386\tools\mkhive\mkhive.exe to (say) Windows\mkhive.exe.<br />
Then run this command:<br />
<br />
mkhive.exe boot\bootdata output-i386\livecd\reactos\system32\config boot\bootdata\livecd.inf boot\bootdata\hiveinst.inf<br />
<br />
Where output-i386\livecd\reactos\system32\config -- is output folder for hives.<br />
This is how ''make livecd'' does it.<br />
And yes, you can add your foo.inf to the end of that command.<br />
|}<br />
<br />
====NTFS====<br />
* post about [http://www.reactos.org/forum/viewtopic.php?f=9&t=8180#p71875 FUSE-lib creation attempts in ROS] in the "[http://www.reactos.org/forum/viewtopic.php?f=9&t=8180 NTFS question]" topic<br />
* (ru) [http://www.reactos.org/forum/viewtopic.php?f=11&t=8606 NTFS-3G applied to ROS], with ''unixed'' 's idea how to integrate into the '''fuse4win''' or '''dokan'''<br />
<br />
====Misc====<br />
* [http://jira.reactos.org/browse/CORE-8059 Possible solution for Intel's HDA] Audio, high-definition audio<br />
* [http://alter.org.ua/soft/win/uni_ata/ UniATA] project of Alter<br />
* [http://alter.org.ua/en/soft/win/vidcontrol/ Display Control for Windows], Alter's site; Now part of [http://alter.org.ua/en/soft/win/uictl/ UI ctl]<br />
<br />
===Serial extension card and MMIO programming===<br />
* [https://android.googlesource.com/kernel/omap/+/glass-omap-xrr02/drivers/tty/serial/8250_early.c android kernel driver tty-serial 8250_early.c] : as serial debug interface, Android can specify not only IO-ports, but also MMIO and MMIO32 addresses. The "shentek" serial card which I own, requires such communication method, it is based on Oxford chip and gives only mmio interface.<br />
* MMIO [http://en.wikipedia.org/wiki/Memory-mapped_I/O MMIO = Memory-mapped_I/O] Linux:[http://nouveau.freedesktop.org/wiki/MmioTrace/ MmioTrace Home] [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/trace/mmiotrace.txt mmiotrace doc]<br />
<br />
**'''Note: I have much info/hands-on to add here...'''<br />
<br />
===Debug prints in ROS===<br />
* [http://alter.org.ua/docs/nt_kernel/kdprint/ KdPrint/DbgPrint and OutputDebugString behavior] at Alter's site,<br />
* [http://www.codeproject.com/KB/winsdk/OutputDebugString.aspx?display=Print Mechanism of OutputDebugString - CodeProject] the ready code sample,<br />
They (articles) discuss internals and mechanism of OutputDebugString. Definitely Windows too (as unices) uses system calls to store and receive debug messages data to/from kernel debug messages buffer.<br />
<br />
** [http://www.reactos.org/wiki/Enable_kernel_tracing ROS: Enable kernel tracing]<br />
<br />
<br />
====Unix dmesg Internals Analysis====<br />
''for comparison and for creating something equivalent/analogous in ROS''<br />
Shortly:<br />
*'''Linux''' has special system call "'''syslog'''" (man 2 syslog)<br />
*'''FreeBSD''' uses its special '''sysctl''' interface to kernel along with "'''kern.msgbuf'''" parameter.<br />
<br />
'''D'''o we need special system call like Linux, or even more, the whole<br />
family of them (sysctl('*')) as in BSD?<br />
How to implement simple system call for it, now?<br />
<br />
---<br />
<br />
Detailed info for unices:<br />
<br />
'''Linux case''':<br />
* syslog(2) - read and/or clear kernel message ring buffer; set console_loglevel<br />
int syslog(int type, char *bufp, int len);<br />
* also /proc/kmsg virtual file, which when being read returns buffer contents<br />
<br />
Excerpt from "man proc":<br />
<pre><br />
/proc/kmsg<br />
This file can be used instead of the syslog(2) system<br />
call to read kernel messages. A<br />
process must have superuser privileges to read this<br />
file, and only one process should read<br />
this file. This file should not be read if a syslog<br />
process is running which uses the sys‐<br />
log(2) system call facility to log kernel messages.<br />
<br />
Information in this file is retrieved with the dmesg(1) program.<br />
</pre><br />
<br />
'''dmesg in FreeBSD''':<br />
*Parameter 'kern.msgbuf' given to sysctl(3) returns contents of kernel message buffer.<br />
*There is also 'kern.msgbuf_clear' to clean the buffer.<br />
<br />
<br />
====/*USB====<br />
These could be probably outdated in sense the USB now is in better working state.<br />
* [http://wiki.osdev.org/Main osdev.org wiki] - main page, [http://wiki.osdev.org/USB USB, the same place]<br />
* USB for NT4:<br />
** Alter's site reviews: [http://alter.org.ua/en/docs/win/nt4_usb/ en], [http://alter.org.ua/ru/docs/win/nt4_usb/ ru]<br />
** Woodheads opensource(!), GPL USB driver: [ftp://piekraste.daba.lv/pub/Service_Pack/NT_4/NT4_USB/HS/ files backed up] [http://www.geocities.com/mypublic99/index.html "Woodhead--NT4--USB" original link (dead)]<br />
** [http://nt4ref.zcm.com.au/usb.htm Windows NT 4.0 and USB] Quote: "Conclusion: I wish people would stop making comments like 'USB is not supported under NT4' - If you must comment please make it accurate, example: 'Microsoft have made the commercial decision not to provide NT4 USB support - but some manufacturers provide support for specific USB devices on NT4.'"<br />
<br />
====*/====<br />
<br />
<br />
=== FreeLoader, debug information, getting===<br />
Related with low-memory bug: 1) 4Gb was recognized as 25Mb 2) ROS started with 25Mb silently eat up 100% CPU and infinitely read from boot CD/HDD.<br />
* Debugging the FreeLdr: [http://jira.reactos.org/secure/attachment/16335/freeldr.patch freeldr.patch turning on debug mode] from [http://jira.reactos.org/browse/CORE-5462 CORE-5462] -- patch by ''rafalh''<br />
* [[FreeLoader]]<br />
<br />
Misc...<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=7915#p68991 by gabrielilardi @ 20 Jan 2010, forum of ROS]<br />
* [http://www.reactos.org/forum/viewtopic.php?p=62488#p62488 by hto @13 Jul 2009]<br />
<br />
===SVN how-to links===<br />
* [http://subversion.apache.org/faq.html] found through google [svn through proxy]<br />
* [http://www.mikepot.com/1544.html], same<br />
* SVN book: [http://svn.zen-cart.org.ua/documentation/en/book/svn-book.html Version Control with Subversion 1.2]<br />
** [http://svn.zen-cart.org.ua/documentation/ru/book/ Same SVN guide, russian]</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna.&diff=36476User:Mna.2015-03-03T12:08:43Z<p>Mna.: /* (Generic) Development */ added JIRA issue query help links</p>
<hr />
<div>My patches to ReactOS// My Bookmarks with useful info// Future place for Manifest-like texts.<br />
<br />
==My Patches/WIP==<br />
''(WIP = Work in Progress)''<br />
* [Done] dmesg/kmesg command in ReactOS native kernel debugger [http://jira.reactos.org/browse/CORE-5452 CORE-5452], described there.<br />
** --<br />
* [Done/not-included] dmesg.exe User-mode utility: done. but not applied (.rbuild system was broken/removed then at the moment + 3 month delay of community considering accepting my kmesg patch).<br />
* [Almost done:forming a patch] (Important thing): MMIO for serial card at kernel early-boot. <del>(MMIO serial cards doesn't work at all in ROS.)</del><br />
** Now it works but I don't know how I will test this on real hardware with [http://jira.reactos.org/browse/CORE-8062 CORE-8062] bug leaving the computer in non-working state after every restart and turn-off.<br />
* [Done] micropatch: print CPUs count and available RAM at ROS start (work related with low-memory related bug)<br />
* (..describe later..: partitions' bug, FAT32-moved-root-node, etc)<br />
* usetup.c - series: [http://jira.reactos.org/browse/CORE-7969 CORE-7969] submitted patch at 08.03.2014: will see how long it will stay not applied. (needed to retest new hanges required by multilanguage support; will do after early-Serial-MMIO)<br />
<br />
==Issues: Reported and not yet==<br />
* [http://jira.reactos.org/browse/CORE-7978 CORE-7978] - ReactOS boot code of MBR can't boot USB-HDD due to error reading sectors with int13h_ah=42h<br />
** Added there link to very good explanation how does GRUB stage1 loader work! Just an amazingly detailed description (and also even with joke in stage2!) [http://thestarman.pcministry.com/asm/mbr/GRUB.htm This] link.<br />
** Workaround: use grub-2 to load freeldr.sys<br />
** freeldr.ini also requires editing the rdisk() parameter addressing the disks:<br />
SystemPath=multi(0)disk(0)rdisk(1)partition(2)\ReactOS<br />
<br />
rdisk(1)partition(2) here means: 2nd disk, 2nd partition. (partitions are 1-counted, rdisks - 0-counted.)<br />
<br />
* [Yet old bug of 2010/11 times until now] (On my machine: AcerAspire5920g) ReactOS loading process stuck on line ...\Drivers\DISK.SYS when Disk operation mode in BIOS is set to AHCI. Changed the mode to IDE "workarounds" the problem: ntoskrnl.exe reaches the last line ...\Drivers\NDIS.SYS -- and is stuck somewhere more later -- eating 100% CPU. (//Debug-log is required)<br />
So the summary: SATA2 is not fully supported by ReactOS, forced to use IDE.<br />
<br />
* [http://jira.reactos.org/browse/CORE-8062 CORE-8062] Nasty bug made me thing my laptop monitor (matrix chip) or videocard goes fried with some code of reactos; Luckily it was just wrong settings somewhere there. Unhealthy bug; leaves bad mood on any tester, it needed to be corrected by any mean.<br />
<br />
==Bookmarks on Topics ==<br />
Interesting topics, links (Started at 2011-04-03)<br />
<br />
Here I will keep links to forum topics, wiki pages or other, that seemed to be interesting:<br />
<br />
====(Generic) Development====<br />
* [irc://irc.freenode.net/reactos #reactos] - For general discussion and user support, most people are here<br />
* [https://reactos.org/wiki/Mumble ROS Mumble] new thing, '15-Feb<br />
* Issues of ReactOS: [https://jira.reactos.org/issues/?jql=status%20WAS%20not%20in%20%28%22Resolved%22%2C%20%22closed%22%29%20ORDER%20BY%20priority%20DESC%2C%20updated%20DESC Open Bugs sorted by priority], [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20ORDER%20BY%20createdDate%20DESC bugs only], [http://jira.reactos.org/issues/?filter=-4 all issues]<br />
** Jira queries (It's an SQL-like thing): [https://confluence.atlassian.com/display/JIRA052/Advanced+Searching#AdvancedSearching-fields JIRA-query fields], [https://confluence.atlassian.com/display/JIRA052/Advanced+Searching#AdvancedSearching-operators JIRA-query operators]<br />
* [[Missing ReactOS Functionality]] - major things absent of ROS from User PoV<br />
* [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20ORDER%20BY%20priority%20DESC%2C%20createdDate%20DESC Sorted by importance (''priority'' now in JIRA) bugs of ReactOS], except of resolved ones<br />
<br />
* [http://www.reactos.org/wiki/How_PnP_Works_in_ReactOS How PnP Works in ReactOS]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8459 ReactOS, how much money it requires?] - here is only the idea, to be converted to become more correct: "How many man-months?", given man-month is more like a myth, reconsider on per-project basis<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8126 HOWTO Become a Reactos Programmer?] - forum topic, could be converted to more constructive instruction<br />
* [http://dslab.epfl.ch/proj/reveng RevEng: Device Driver Reverse Engineering] from [http://www.reactos.org/forum/viewtopic.php?f=9&t=7990 here]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8206 Command-line-only Win32 from ReactOS?] The topic about full OS without GUI ("headless"?).<br />
** Resembles me idea of [http://hex.pp.ua/nt-native-applications-shell-eng.php Windows/ReactOS Native Shell]) ([http://www.reactos.org/forum/viewtopic.php?f=11&t=9092 Russian]).<br />
<br />
====bootCD and liveCD repositories====<br />
* [http://iso.reactos.org/bootcd/ bootcd repository] iso.reactos.org bootcd images<br />
* [http://iso.reactos.org/livecd/ livecd repository]<br />
<br />
====ReactOS startup procedure described (partly) ====<br />
* [[Modify the final ISO image]] - good article, have also notes on how (bootcd) final CD-image is composed -- i.e. CD directory structure <br />
* [[FreeLoader]] details<br />
* [[User:Mna./FreeLoader,_bootcd_and_bootrecords#FreeLoader_freeldr_Architecture|freeldr Architecture]] and related ReactOS startup steps:<br />
* [[User:Mna./FreeLoader,_bootcd_and_bootrecords|bootcd and bootrecords]]<br />
* [http://en.wikipedia.org/wiki/Windows_NT_Startup_Process Windows NT Startup Process/ Sequence]<br />
* [[User:Mna./ReactOS startup process light summary]]<br />
* [[How the system Finds and Loads Drivers]]<br />
<br />
==== ROS build system hands-on ====<br />
* [[Building_Modules#List_available_ninja_targets|available ninja targets]]<br />
* [[Building_Modules#Removing_or_Updating_a_Module|Updating a module code]] -- do this when the ROS module code was changed and build system didn't notice<br />
* Strange thing become clear; Ctrl+D doesn't work in 1st stage setup.<br />
BootOptions=DbgOsLoadOptions = "/NOGUIBOOT /DEBUGPORT=COM:io,0x3f8,115200n8 /DEBUGPORT=SCREEN" See also [[User:Mna./FreeLoader_freeldr_Architecture#Specifing_Boot_Options|Specifing Boot kernel Options]] ((Not confuse it with [[Boot_options#Options|Boot Options]]))<br />
<br />
====Filesystems generic====<br />
* [[File Systems]], a good page<br />
<br />
====Editing ReactOS registry offline====<br />
From [http://www.reactos.org/forum/viewtopic.php?t=3162 here]<br />
{| class="wikitable"<br />
|-<br />
| <br />
Editing ReactOS registry hives outside ReactOS?<br />
--2006-12<br />
<br />
> Is it possible at this moment to edit the registry hives outside the ReactOS environment?<br />
> I wanted to automate a process to load these registry hives onto the local registry, <br />
> add all my changes, unload the hives and create a new ISO.<br />
<br />
Simply change registry sources and build your own binary hives from them.<br />
<br />
by hto <br/><br />
<br />
> I guess "make" is the prefered way, there isn't any other method for creating these hives?<br /><br />
<br />
There is hive maker in tools\mkhive. You can build it with mingw32-make.exe mkhive<br />
<br />
Copy it from output-i386\tools\mkhive\mkhive.exe to (say) Windows\mkhive.exe.<br />
Then run this command:<br />
<br />
mkhive.exe boot\bootdata output-i386\livecd\reactos\system32\config boot\bootdata\livecd.inf boot\bootdata\hiveinst.inf<br />
<br />
Where output-i386\livecd\reactos\system32\config -- is output folder for hives.<br />
This is how ''make livecd'' does it.<br />
And yes, you can add your foo.inf to the end of that command.<br />
|}<br />
<br />
====NTFS====<br />
* post about [http://www.reactos.org/forum/viewtopic.php?f=9&t=8180#p71875 FUSE-lib creation attempts in ROS] in the "[http://www.reactos.org/forum/viewtopic.php?f=9&t=8180 NTFS question]" topic<br />
* (ru) [http://www.reactos.org/forum/viewtopic.php?f=11&t=8606 NTFS-3G applied to ROS], with ''unixed'' 's idea how to integrate into the '''fuse4win''' or '''dokan'''<br />
<br />
====Misc====<br />
* [http://jira.reactos.org/browse/CORE-8059 Possible solution for Intel's HDA] Audio, high-definition audio<br />
* [http://alter.org.ua/soft/win/uni_ata/ UniATA] project of Alter<br />
* [http://alter.org.ua/en/soft/win/vidcontrol/ Display Control for Windows], Alter's site; Now part of [http://alter.org.ua/en/soft/win/uictl/ UI ctl]<br />
<br />
===Serial extension card and MMIO programming===<br />
* [https://android.googlesource.com/kernel/omap/+/glass-omap-xrr02/drivers/tty/serial/8250_early.c android kernel driver tty-serial 8250_early.c] : as serial debug interface, Android can specify not only IO-ports, but also MMIO and MMIO32 addresses. The "shentek" serial card which I own, requires such communication method, it is based on Oxford chip and gives only mmio interface.<br />
* MMIO [http://en.wikipedia.org/wiki/Memory-mapped_I/O MMIO = Memory-mapped_I/O] Linux:[http://nouveau.freedesktop.org/wiki/MmioTrace/ MmioTrace Home] [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/trace/mmiotrace.txt mmiotrace doc]<br />
<br />
**'''Note: I have much info/hands-on to add here...'''<br />
<br />
===Debug prints in ROS===<br />
* [http://alter.org.ua/docs/nt_kernel/kdprint/ KdPrint/DbgPrint and OutputDebugString behavior] at Alter's site,<br />
* [http://www.codeproject.com/KB/winsdk/OutputDebugString.aspx?display=Print Mechanism of OutputDebugString - CodeProject] the ready code sample,<br />
They (articles) discuss internals and mechanism of OutputDebugString. Definitely Windows too (as unices) uses system calls to store and receive debug messages data to/from kernel debug messages buffer.<br />
<br />
** [http://www.reactos.org/wiki/Enable_kernel_tracing ROS: Enable kernel tracing]<br />
<br />
<br />
====Unix dmesg Internals Analysis====<br />
''for comparison and for creating something equivalent/analogous in ROS''<br />
Shortly:<br />
*'''Linux''' has special system call "'''syslog'''" (man 2 syslog)<br />
*'''FreeBSD''' uses its special '''sysctl''' interface to kernel along with "'''kern.msgbuf'''" parameter.<br />
<br />
'''D'''o we need special system call like Linux, or even more, the whole<br />
family of them (sysctl('*')) as in BSD?<br />
How to implement simple system call for it, now?<br />
<br />
---<br />
<br />
Detailed info for unices:<br />
<br />
'''Linux case''':<br />
* syslog(2) - read and/or clear kernel message ring buffer; set console_loglevel<br />
int syslog(int type, char *bufp, int len);<br />
* also /proc/kmsg virtual file, which when being read returns buffer contents<br />
<br />
Excerpt from "man proc":<br />
<pre><br />
/proc/kmsg<br />
This file can be used instead of the syslog(2) system<br />
call to read kernel messages. A<br />
process must have superuser privileges to read this<br />
file, and only one process should read<br />
this file. This file should not be read if a syslog<br />
process is running which uses the sys‐<br />
log(2) system call facility to log kernel messages.<br />
<br />
Information in this file is retrieved with the dmesg(1) program.<br />
</pre><br />
<br />
'''dmesg in FreeBSD''':<br />
*Parameter 'kern.msgbuf' given to sysctl(3) returns contents of kernel message buffer.<br />
*There is also 'kern.msgbuf_clear' to clean the buffer.<br />
<br />
<br />
====/*USB====<br />
These could be probably outdated in sense the USB now is in better working state.<br />
* [http://wiki.osdev.org/Main osdev.org wiki] - main page, [http://wiki.osdev.org/USB USB, the same place]<br />
* USB for NT4:<br />
** Alter's site reviews: [http://alter.org.ua/en/docs/win/nt4_usb/ en], [http://alter.org.ua/ru/docs/win/nt4_usb/ ru]<br />
** Woodheads opensource(!), GPL USB driver: [ftp://piekraste.daba.lv/pub/Service_Pack/NT_4/NT4_USB/HS/ files backed up] [http://www.geocities.com/mypublic99/index.html "Woodhead--NT4--USB" original link (dead)]<br />
** [http://nt4ref.zcm.com.au/usb.htm Windows NT 4.0 and USB] Quote: "Conclusion: I wish people would stop making comments like 'USB is not supported under NT4' - If you must comment please make it accurate, example: 'Microsoft have made the commercial decision not to provide NT4 USB support - but some manufacturers provide support for specific USB devices on NT4.'"<br />
<br />
====*/====<br />
<br />
<br />
=== FreeLoader, debug information, getting===<br />
Related with low-memory bug: 1) 4Gb was recognized as 25Mb 2) ROS started with 25Mb silently eat up 100% CPU and infinitely read from boot CD/HDD.<br />
* Debugging the FreeLdr: [http://jira.reactos.org/secure/attachment/16335/freeldr.patch freeldr.patch turning on debug mode] from [http://jira.reactos.org/browse/CORE-5462 CORE-5462] -- patch by ''rafalh''<br />
* [[FreeLoader]]<br />
<br />
Misc...<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=7915#p68991 by gabrielilardi @ 20 Jan 2010, forum of ROS]<br />
* [http://www.reactos.org/forum/viewtopic.php?p=62488#p62488 by hto @13 Jul 2009]<br />
<br />
===SVN how-to links===<br />
* [http://subversion.apache.org/faq.html] found through google [svn through proxy]<br />
* [http://www.mikepot.com/1544.html], same<br />
* SVN book: [http://svn.zen-cart.org.ua/documentation/en/book/svn-book.html Version Control with Subversion 1.2]<br />
** [http://svn.zen-cart.org.ua/documentation/ru/book/ Same SVN guide, russian]</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna.&diff=36475User:Mna.2015-03-03T12:04:50Z<p>Mna.: /* (Generic) Development */ added link to personal bookmark</p>
<hr />
<div>My patches to ReactOS// My Bookmarks with useful info// Future place for Manifest-like texts.<br />
<br />
==My Patches/WIP==<br />
''(WIP = Work in Progress)''<br />
* [Done] dmesg/kmesg command in ReactOS native kernel debugger [http://jira.reactos.org/browse/CORE-5452 CORE-5452], described there.<br />
** --<br />
* [Done/not-included] dmesg.exe User-mode utility: done. but not applied (.rbuild system was broken/removed then at the moment + 3 month delay of community considering accepting my kmesg patch).<br />
* [Almost done:forming a patch] (Important thing): MMIO for serial card at kernel early-boot. <del>(MMIO serial cards doesn't work at all in ROS.)</del><br />
** Now it works but I don't know how I will test this on real hardware with [http://jira.reactos.org/browse/CORE-8062 CORE-8062] bug leaving the computer in non-working state after every restart and turn-off.<br />
* [Done] micropatch: print CPUs count and available RAM at ROS start (work related with low-memory related bug)<br />
* (..describe later..: partitions' bug, FAT32-moved-root-node, etc)<br />
* usetup.c - series: [http://jira.reactos.org/browse/CORE-7969 CORE-7969] submitted patch at 08.03.2014: will see how long it will stay not applied. (needed to retest new hanges required by multilanguage support; will do after early-Serial-MMIO)<br />
<br />
==Issues: Reported and not yet==<br />
* [http://jira.reactos.org/browse/CORE-7978 CORE-7978] - ReactOS boot code of MBR can't boot USB-HDD due to error reading sectors with int13h_ah=42h<br />
** Added there link to very good explanation how does GRUB stage1 loader work! Just an amazingly detailed description (and also even with joke in stage2!) [http://thestarman.pcministry.com/asm/mbr/GRUB.htm This] link.<br />
** Workaround: use grub-2 to load freeldr.sys<br />
** freeldr.ini also requires editing the rdisk() parameter addressing the disks:<br />
SystemPath=multi(0)disk(0)rdisk(1)partition(2)\ReactOS<br />
<br />
rdisk(1)partition(2) here means: 2nd disk, 2nd partition. (partitions are 1-counted, rdisks - 0-counted.)<br />
<br />
* [Yet old bug of 2010/11 times until now] (On my machine: AcerAspire5920g) ReactOS loading process stuck on line ...\Drivers\DISK.SYS when Disk operation mode in BIOS is set to AHCI. Changed the mode to IDE "workarounds" the problem: ntoskrnl.exe reaches the last line ...\Drivers\NDIS.SYS -- and is stuck somewhere more later -- eating 100% CPU. (//Debug-log is required)<br />
So the summary: SATA2 is not fully supported by ReactOS, forced to use IDE.<br />
<br />
* [http://jira.reactos.org/browse/CORE-8062 CORE-8062] Nasty bug made me thing my laptop monitor (matrix chip) or videocard goes fried with some code of reactos; Luckily it was just wrong settings somewhere there. Unhealthy bug; leaves bad mood on any tester, it needed to be corrected by any mean.<br />
<br />
==Bookmarks on Topics ==<br />
Interesting topics, links (Started at 2011-04-03)<br />
<br />
Here I will keep links to forum topics, wiki pages or other, that seemed to be interesting:<br />
<br />
====(Generic) Development====<br />
* [irc://irc.freenode.net/reactos #reactos] - For general discussion and user support, most people are here<br />
* [https://reactos.org/wiki/Mumble ROS Mumble] new thing, '15-Feb<br />
* Issues of ReactOS: [https://jira.reactos.org/issues/?jql=status%20WAS%20not%20in%20%28%22Resolved%22%2C%20%22closed%22%29%20ORDER%20BY%20priority%20DESC%2C%20updated%20DESC Open Bugs sorted by priority], [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20ORDER%20BY%20createdDate%20DESC bugs only], [http://jira.reactos.org/issues/?filter=-4 all issues]<br />
* [[Missing ReactOS Functionality]] - major things absent of ROS from User PoV<br />
* [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20ORDER%20BY%20priority%20DESC%2C%20createdDate%20DESC Sorted by importance (''priority'' now in JIRA) bugs of ReactOS], except of resolved ones<br />
<br />
* [http://www.reactos.org/wiki/How_PnP_Works_in_ReactOS How PnP Works in ReactOS]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8459 ReactOS, how much money it requires?] - here is only the idea, to be converted to become more correct: "How many man-months?", given man-month is more like a myth, reconsider on per-project basis<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8126 HOWTO Become a Reactos Programmer?] - forum topic, could be converted to more constructive instruction<br />
* [http://dslab.epfl.ch/proj/reveng RevEng: Device Driver Reverse Engineering] from [http://www.reactos.org/forum/viewtopic.php?f=9&t=7990 here]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8206 Command-line-only Win32 from ReactOS?] The topic about full OS without GUI ("headless"?).<br />
** Resembles me idea of [http://hex.pp.ua/nt-native-applications-shell-eng.php Windows/ReactOS Native Shell]) ([http://www.reactos.org/forum/viewtopic.php?f=11&t=9092 Russian]).<br />
<br />
====bootCD and liveCD repositories====<br />
* [http://iso.reactos.org/bootcd/ bootcd repository] iso.reactos.org bootcd images<br />
* [http://iso.reactos.org/livecd/ livecd repository]<br />
<br />
====ReactOS startup procedure described (partly) ====<br />
* [[Modify the final ISO image]] - good article, have also notes on how (bootcd) final CD-image is composed -- i.e. CD directory structure <br />
* [[FreeLoader]] details<br />
* [[User:Mna./FreeLoader,_bootcd_and_bootrecords#FreeLoader_freeldr_Architecture|freeldr Architecture]] and related ReactOS startup steps:<br />
* [[User:Mna./FreeLoader,_bootcd_and_bootrecords|bootcd and bootrecords]]<br />
* [http://en.wikipedia.org/wiki/Windows_NT_Startup_Process Windows NT Startup Process/ Sequence]<br />
* [[User:Mna./ReactOS startup process light summary]]<br />
* [[How the system Finds and Loads Drivers]]<br />
<br />
==== ROS build system hands-on ====<br />
* [[Building_Modules#List_available_ninja_targets|available ninja targets]]<br />
* [[Building_Modules#Removing_or_Updating_a_Module|Updating a module code]] -- do this when the ROS module code was changed and build system didn't notice<br />
* Strange thing become clear; Ctrl+D doesn't work in 1st stage setup.<br />
BootOptions=DbgOsLoadOptions = "/NOGUIBOOT /DEBUGPORT=COM:io,0x3f8,115200n8 /DEBUGPORT=SCREEN" See also [[User:Mna./FreeLoader_freeldr_Architecture#Specifing_Boot_Options|Specifing Boot kernel Options]] ((Not confuse it with [[Boot_options#Options|Boot Options]]))<br />
<br />
====Filesystems generic====<br />
* [[File Systems]], a good page<br />
<br />
====Editing ReactOS registry offline====<br />
From [http://www.reactos.org/forum/viewtopic.php?t=3162 here]<br />
{| class="wikitable"<br />
|-<br />
| <br />
Editing ReactOS registry hives outside ReactOS?<br />
--2006-12<br />
<br />
> Is it possible at this moment to edit the registry hives outside the ReactOS environment?<br />
> I wanted to automate a process to load these registry hives onto the local registry, <br />
> add all my changes, unload the hives and create a new ISO.<br />
<br />
Simply change registry sources and build your own binary hives from them.<br />
<br />
by hto <br/><br />
<br />
> I guess "make" is the prefered way, there isn't any other method for creating these hives?<br /><br />
<br />
There is hive maker in tools\mkhive. You can build it with mingw32-make.exe mkhive<br />
<br />
Copy it from output-i386\tools\mkhive\mkhive.exe to (say) Windows\mkhive.exe.<br />
Then run this command:<br />
<br />
mkhive.exe boot\bootdata output-i386\livecd\reactos\system32\config boot\bootdata\livecd.inf boot\bootdata\hiveinst.inf<br />
<br />
Where output-i386\livecd\reactos\system32\config -- is output folder for hives.<br />
This is how ''make livecd'' does it.<br />
And yes, you can add your foo.inf to the end of that command.<br />
|}<br />
<br />
====NTFS====<br />
* post about [http://www.reactos.org/forum/viewtopic.php?f=9&t=8180#p71875 FUSE-lib creation attempts in ROS] in the "[http://www.reactos.org/forum/viewtopic.php?f=9&t=8180 NTFS question]" topic<br />
* (ru) [http://www.reactos.org/forum/viewtopic.php?f=11&t=8606 NTFS-3G applied to ROS], with ''unixed'' 's idea how to integrate into the '''fuse4win''' or '''dokan'''<br />
<br />
====Misc====<br />
* [http://jira.reactos.org/browse/CORE-8059 Possible solution for Intel's HDA] Audio, high-definition audio<br />
* [http://alter.org.ua/soft/win/uni_ata/ UniATA] project of Alter<br />
* [http://alter.org.ua/en/soft/win/vidcontrol/ Display Control for Windows], Alter's site; Now part of [http://alter.org.ua/en/soft/win/uictl/ UI ctl]<br />
<br />
===Serial extension card and MMIO programming===<br />
* [https://android.googlesource.com/kernel/omap/+/glass-omap-xrr02/drivers/tty/serial/8250_early.c android kernel driver tty-serial 8250_early.c] : as serial debug interface, Android can specify not only IO-ports, but also MMIO and MMIO32 addresses. The "shentek" serial card which I own, requires such communication method, it is based on Oxford chip and gives only mmio interface.<br />
* MMIO [http://en.wikipedia.org/wiki/Memory-mapped_I/O MMIO = Memory-mapped_I/O] Linux:[http://nouveau.freedesktop.org/wiki/MmioTrace/ MmioTrace Home] [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/trace/mmiotrace.txt mmiotrace doc]<br />
<br />
**'''Note: I have much info/hands-on to add here...'''<br />
<br />
===Debug prints in ROS===<br />
* [http://alter.org.ua/docs/nt_kernel/kdprint/ KdPrint/DbgPrint and OutputDebugString behavior] at Alter's site,<br />
* [http://www.codeproject.com/KB/winsdk/OutputDebugString.aspx?display=Print Mechanism of OutputDebugString - CodeProject] the ready code sample,<br />
They (articles) discuss internals and mechanism of OutputDebugString. Definitely Windows too (as unices) uses system calls to store and receive debug messages data to/from kernel debug messages buffer.<br />
<br />
** [http://www.reactos.org/wiki/Enable_kernel_tracing ROS: Enable kernel tracing]<br />
<br />
<br />
====Unix dmesg Internals Analysis====<br />
''for comparison and for creating something equivalent/analogous in ROS''<br />
Shortly:<br />
*'''Linux''' has special system call "'''syslog'''" (man 2 syslog)<br />
*'''FreeBSD''' uses its special '''sysctl''' interface to kernel along with "'''kern.msgbuf'''" parameter.<br />
<br />
'''D'''o we need special system call like Linux, or even more, the whole<br />
family of them (sysctl('*')) as in BSD?<br />
How to implement simple system call for it, now?<br />
<br />
---<br />
<br />
Detailed info for unices:<br />
<br />
'''Linux case''':<br />
* syslog(2) - read and/or clear kernel message ring buffer; set console_loglevel<br />
int syslog(int type, char *bufp, int len);<br />
* also /proc/kmsg virtual file, which when being read returns buffer contents<br />
<br />
Excerpt from "man proc":<br />
<pre><br />
/proc/kmsg<br />
This file can be used instead of the syslog(2) system<br />
call to read kernel messages. A<br />
process must have superuser privileges to read this<br />
file, and only one process should read<br />
this file. This file should not be read if a syslog<br />
process is running which uses the sys‐<br />
log(2) system call facility to log kernel messages.<br />
<br />
Information in this file is retrieved with the dmesg(1) program.<br />
</pre><br />
<br />
'''dmesg in FreeBSD''':<br />
*Parameter 'kern.msgbuf' given to sysctl(3) returns contents of kernel message buffer.<br />
*There is also 'kern.msgbuf_clear' to clean the buffer.<br />
<br />
<br />
====/*USB====<br />
These could be probably outdated in sense the USB now is in better working state.<br />
* [http://wiki.osdev.org/Main osdev.org wiki] - main page, [http://wiki.osdev.org/USB USB, the same place]<br />
* USB for NT4:<br />
** Alter's site reviews: [http://alter.org.ua/en/docs/win/nt4_usb/ en], [http://alter.org.ua/ru/docs/win/nt4_usb/ ru]<br />
** Woodheads opensource(!), GPL USB driver: [ftp://piekraste.daba.lv/pub/Service_Pack/NT_4/NT4_USB/HS/ files backed up] [http://www.geocities.com/mypublic99/index.html "Woodhead--NT4--USB" original link (dead)]<br />
** [http://nt4ref.zcm.com.au/usb.htm Windows NT 4.0 and USB] Quote: "Conclusion: I wish people would stop making comments like 'USB is not supported under NT4' - If you must comment please make it accurate, example: 'Microsoft have made the commercial decision not to provide NT4 USB support - but some manufacturers provide support for specific USB devices on NT4.'"<br />
<br />
====*/====<br />
<br />
<br />
=== FreeLoader, debug information, getting===<br />
Related with low-memory bug: 1) 4Gb was recognized as 25Mb 2) ROS started with 25Mb silently eat up 100% CPU and infinitely read from boot CD/HDD.<br />
* Debugging the FreeLdr: [http://jira.reactos.org/secure/attachment/16335/freeldr.patch freeldr.patch turning on debug mode] from [http://jira.reactos.org/browse/CORE-5462 CORE-5462] -- patch by ''rafalh''<br />
* [[FreeLoader]]<br />
<br />
Misc...<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=7915#p68991 by gabrielilardi @ 20 Jan 2010, forum of ROS]<br />
* [http://www.reactos.org/forum/viewtopic.php?p=62488#p62488 by hto @13 Jul 2009]<br />
<br />
===SVN how-to links===<br />
* [http://subversion.apache.org/faq.html] found through google [svn through proxy]<br />
* [http://www.mikepot.com/1544.html], same<br />
* SVN book: [http://svn.zen-cart.org.ua/documentation/en/book/svn-book.html Version Control with Subversion 1.2]<br />
** [http://svn.zen-cart.org.ua/documentation/ru/book/ Same SVN guide, russian]</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna.&diff=36474User:Mna.2015-03-03T11:35:58Z<p>Mna.: /* (Generic) Development */</p>
<hr />
<div>My patches to ReactOS// My Bookmarks with useful info// Future place for Manifest-like texts.<br />
<br />
==My Patches/WIP==<br />
''(WIP = Work in Progress)''<br />
* [Done] dmesg/kmesg command in ReactOS native kernel debugger [http://jira.reactos.org/browse/CORE-5452 CORE-5452], described there.<br />
** --<br />
* [Done/not-included] dmesg.exe User-mode utility: done. but not applied (.rbuild system was broken/removed then at the moment + 3 month delay of community considering accepting my kmesg patch).<br />
* [Almost done:forming a patch] (Important thing): MMIO for serial card at kernel early-boot. <del>(MMIO serial cards doesn't work at all in ROS.)</del><br />
** Now it works but I don't know how I will test this on real hardware with [http://jira.reactos.org/browse/CORE-8062 CORE-8062] bug leaving the computer in non-working state after every restart and turn-off.<br />
* [Done] micropatch: print CPUs count and available RAM at ROS start (work related with low-memory related bug)<br />
* (..describe later..: partitions' bug, FAT32-moved-root-node, etc)<br />
* usetup.c - series: [http://jira.reactos.org/browse/CORE-7969 CORE-7969] submitted patch at 08.03.2014: will see how long it will stay not applied. (needed to retest new hanges required by multilanguage support; will do after early-Serial-MMIO)<br />
<br />
==Issues: Reported and not yet==<br />
* [http://jira.reactos.org/browse/CORE-7978 CORE-7978] - ReactOS boot code of MBR can't boot USB-HDD due to error reading sectors with int13h_ah=42h<br />
** Added there link to very good explanation how does GRUB stage1 loader work! Just an amazingly detailed description (and also even with joke in stage2!) [http://thestarman.pcministry.com/asm/mbr/GRUB.htm This] link.<br />
** Workaround: use grub-2 to load freeldr.sys<br />
** freeldr.ini also requires editing the rdisk() parameter addressing the disks:<br />
SystemPath=multi(0)disk(0)rdisk(1)partition(2)\ReactOS<br />
<br />
rdisk(1)partition(2) here means: 2nd disk, 2nd partition. (partitions are 1-counted, rdisks - 0-counted.)<br />
<br />
* [Yet old bug of 2010/11 times until now] (On my machine: AcerAspire5920g) ReactOS loading process stuck on line ...\Drivers\DISK.SYS when Disk operation mode in BIOS is set to AHCI. Changed the mode to IDE "workarounds" the problem: ntoskrnl.exe reaches the last line ...\Drivers\NDIS.SYS -- and is stuck somewhere more later -- eating 100% CPU. (//Debug-log is required)<br />
So the summary: SATA2 is not fully supported by ReactOS, forced to use IDE.<br />
<br />
* [http://jira.reactos.org/browse/CORE-8062 CORE-8062] Nasty bug made me thing my laptop monitor (matrix chip) or videocard goes fried with some code of reactos; Luckily it was just wrong settings somewhere there. Unhealthy bug; leaves bad mood on any tester, it needed to be corrected by any mean.<br />
<br />
==Bookmarks on Topics ==<br />
Interesting topics, links (Started at 2011-04-03)<br />
<br />
Here I will keep links to forum topics, wiki pages or other, that seemed to be interesting:<br />
<br />
====(Generic) Development====<br />
* [irc://irc.freenode.net/reactos #reactos] - For general discussion and user support, most people are here<br />
* [https://reactos.org/wiki/Mumble ROS Mumble] new thing, '15-Feb<br />
* [http://jira.reactos.org/issues/?filter=-4 All issues of ReactOS] [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20ORDER%20BY%20createdDate%20DESC bugs only]<br />
* [[Missing ReactOS Functionality]] - major things absent of ROS from User PoV<br />
* [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20ORDER%20BY%20priority%20DESC%2C%20createdDate%20DESC Sorted by importance (''priority'' now in JIRA) bugs of ReactOS], except of resolved ones<br />
<br />
* [http://www.reactos.org/wiki/How_PnP_Works_in_ReactOS How PnP Works in ReactOS]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8459 ReactOS, how much money it requires?] - here is only the idea, to be converted to become more correct: "How many man-months?", given man-month is more like a myth, reconsider on per-project basis<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8126 HOWTO Become a Reactos Programmer?] - forum topic, could be converted to more constructive instruction<br />
* [http://dslab.epfl.ch/proj/reveng RevEng: Device Driver Reverse Engineering] from [http://www.reactos.org/forum/viewtopic.php?f=9&t=7990 here]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8206 Command-line-only Win32 from ReactOS?] The topic about full OS without GUI ("headless"?).<br />
** Resembles me idea of [http://hex.pp.ua/nt-native-applications-shell-eng.php Windows/ReactOS Native Shell]) ([http://www.reactos.org/forum/viewtopic.php?f=11&t=9092 Russian]).<br />
<br />
====bootCD and liveCD repositories====<br />
* [http://iso.reactos.org/bootcd/ bootcd repository] iso.reactos.org bootcd images<br />
* [http://iso.reactos.org/livecd/ livecd repository]<br />
<br />
====ReactOS startup procedure described (partly) ====<br />
* [[Modify the final ISO image]] - good article, have also notes on how (bootcd) final CD-image is composed -- i.e. CD directory structure <br />
* [[FreeLoader]] details<br />
* [[User:Mna./FreeLoader,_bootcd_and_bootrecords#FreeLoader_freeldr_Architecture|freeldr Architecture]] and related ReactOS startup steps:<br />
* [[User:Mna./FreeLoader,_bootcd_and_bootrecords|bootcd and bootrecords]]<br />
* [http://en.wikipedia.org/wiki/Windows_NT_Startup_Process Windows NT Startup Process/ Sequence]<br />
* [[User:Mna./ReactOS startup process light summary]]<br />
* [[How the system Finds and Loads Drivers]]<br />
<br />
==== ROS build system hands-on ====<br />
* [[Building_Modules#List_available_ninja_targets|available ninja targets]]<br />
* [[Building_Modules#Removing_or_Updating_a_Module|Updating a module code]] -- do this when the ROS module code was changed and build system didn't notice<br />
* Strange thing become clear; Ctrl+D doesn't work in 1st stage setup.<br />
BootOptions=DbgOsLoadOptions = "/NOGUIBOOT /DEBUGPORT=COM:io,0x3f8,115200n8 /DEBUGPORT=SCREEN" See also [[User:Mna./FreeLoader_freeldr_Architecture#Specifing_Boot_Options|Specifing Boot kernel Options]] ((Not confuse it with [[Boot_options#Options|Boot Options]]))<br />
<br />
====Filesystems generic====<br />
* [[File Systems]], a good page<br />
<br />
====Editing ReactOS registry offline====<br />
From [http://www.reactos.org/forum/viewtopic.php?t=3162 here]<br />
{| class="wikitable"<br />
|-<br />
| <br />
Editing ReactOS registry hives outside ReactOS?<br />
--2006-12<br />
<br />
> Is it possible at this moment to edit the registry hives outside the ReactOS environment?<br />
> I wanted to automate a process to load these registry hives onto the local registry, <br />
> add all my changes, unload the hives and create a new ISO.<br />
<br />
Simply change registry sources and build your own binary hives from them.<br />
<br />
by hto <br/><br />
<br />
> I guess "make" is the prefered way, there isn't any other method for creating these hives?<br /><br />
<br />
There is hive maker in tools\mkhive. You can build it with mingw32-make.exe mkhive<br />
<br />
Copy it from output-i386\tools\mkhive\mkhive.exe to (say) Windows\mkhive.exe.<br />
Then run this command:<br />
<br />
mkhive.exe boot\bootdata output-i386\livecd\reactos\system32\config boot\bootdata\livecd.inf boot\bootdata\hiveinst.inf<br />
<br />
Where output-i386\livecd\reactos\system32\config -- is output folder for hives.<br />
This is how ''make livecd'' does it.<br />
And yes, you can add your foo.inf to the end of that command.<br />
|}<br />
<br />
====NTFS====<br />
* post about [http://www.reactos.org/forum/viewtopic.php?f=9&t=8180#p71875 FUSE-lib creation attempts in ROS] in the "[http://www.reactos.org/forum/viewtopic.php?f=9&t=8180 NTFS question]" topic<br />
* (ru) [http://www.reactos.org/forum/viewtopic.php?f=11&t=8606 NTFS-3G applied to ROS], with ''unixed'' 's idea how to integrate into the '''fuse4win''' or '''dokan'''<br />
<br />
====Misc====<br />
* [http://jira.reactos.org/browse/CORE-8059 Possible solution for Intel's HDA] Audio, high-definition audio<br />
* [http://alter.org.ua/soft/win/uni_ata/ UniATA] project of Alter<br />
* [http://alter.org.ua/en/soft/win/vidcontrol/ Display Control for Windows], Alter's site; Now part of [http://alter.org.ua/en/soft/win/uictl/ UI ctl]<br />
<br />
===Serial extension card and MMIO programming===<br />
* [https://android.googlesource.com/kernel/omap/+/glass-omap-xrr02/drivers/tty/serial/8250_early.c android kernel driver tty-serial 8250_early.c] : as serial debug interface, Android can specify not only IO-ports, but also MMIO and MMIO32 addresses. The "shentek" serial card which I own, requires such communication method, it is based on Oxford chip and gives only mmio interface.<br />
* MMIO [http://en.wikipedia.org/wiki/Memory-mapped_I/O MMIO = Memory-mapped_I/O] Linux:[http://nouveau.freedesktop.org/wiki/MmioTrace/ MmioTrace Home] [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/trace/mmiotrace.txt mmiotrace doc]<br />
<br />
**'''Note: I have much info/hands-on to add here...'''<br />
<br />
===Debug prints in ROS===<br />
* [http://alter.org.ua/docs/nt_kernel/kdprint/ KdPrint/DbgPrint and OutputDebugString behavior] at Alter's site,<br />
* [http://www.codeproject.com/KB/winsdk/OutputDebugString.aspx?display=Print Mechanism of OutputDebugString - CodeProject] the ready code sample,<br />
They (articles) discuss internals and mechanism of OutputDebugString. Definitely Windows too (as unices) uses system calls to store and receive debug messages data to/from kernel debug messages buffer.<br />
<br />
** [http://www.reactos.org/wiki/Enable_kernel_tracing ROS: Enable kernel tracing]<br />
<br />
<br />
====Unix dmesg Internals Analysis====<br />
''for comparison and for creating something equivalent/analogous in ROS''<br />
Shortly:<br />
*'''Linux''' has special system call "'''syslog'''" (man 2 syslog)<br />
*'''FreeBSD''' uses its special '''sysctl''' interface to kernel along with "'''kern.msgbuf'''" parameter.<br />
<br />
'''D'''o we need special system call like Linux, or even more, the whole<br />
family of them (sysctl('*')) as in BSD?<br />
How to implement simple system call for it, now?<br />
<br />
---<br />
<br />
Detailed info for unices:<br />
<br />
'''Linux case''':<br />
* syslog(2) - read and/or clear kernel message ring buffer; set console_loglevel<br />
int syslog(int type, char *bufp, int len);<br />
* also /proc/kmsg virtual file, which when being read returns buffer contents<br />
<br />
Excerpt from "man proc":<br />
<pre><br />
/proc/kmsg<br />
This file can be used instead of the syslog(2) system<br />
call to read kernel messages. A<br />
process must have superuser privileges to read this<br />
file, and only one process should read<br />
this file. This file should not be read if a syslog<br />
process is running which uses the sys‐<br />
log(2) system call facility to log kernel messages.<br />
<br />
Information in this file is retrieved with the dmesg(1) program.<br />
</pre><br />
<br />
'''dmesg in FreeBSD''':<br />
*Parameter 'kern.msgbuf' given to sysctl(3) returns contents of kernel message buffer.<br />
*There is also 'kern.msgbuf_clear' to clean the buffer.<br />
<br />
<br />
====/*USB====<br />
These could be probably outdated in sense the USB now is in better working state.<br />
* [http://wiki.osdev.org/Main osdev.org wiki] - main page, [http://wiki.osdev.org/USB USB, the same place]<br />
* USB for NT4:<br />
** Alter's site reviews: [http://alter.org.ua/en/docs/win/nt4_usb/ en], [http://alter.org.ua/ru/docs/win/nt4_usb/ ru]<br />
** Woodheads opensource(!), GPL USB driver: [ftp://piekraste.daba.lv/pub/Service_Pack/NT_4/NT4_USB/HS/ files backed up] [http://www.geocities.com/mypublic99/index.html "Woodhead--NT4--USB" original link (dead)]<br />
** [http://nt4ref.zcm.com.au/usb.htm Windows NT 4.0 and USB] Quote: "Conclusion: I wish people would stop making comments like 'USB is not supported under NT4' - If you must comment please make it accurate, example: 'Microsoft have made the commercial decision not to provide NT4 USB support - but some manufacturers provide support for specific USB devices on NT4.'"<br />
<br />
====*/====<br />
<br />
<br />
=== FreeLoader, debug information, getting===<br />
Related with low-memory bug: 1) 4Gb was recognized as 25Mb 2) ROS started with 25Mb silently eat up 100% CPU and infinitely read from boot CD/HDD.<br />
* Debugging the FreeLdr: [http://jira.reactos.org/secure/attachment/16335/freeldr.patch freeldr.patch turning on debug mode] from [http://jira.reactos.org/browse/CORE-5462 CORE-5462] -- patch by ''rafalh''<br />
* [[FreeLoader]]<br />
<br />
Misc...<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=7915#p68991 by gabrielilardi @ 20 Jan 2010, forum of ROS]<br />
* [http://www.reactos.org/forum/viewtopic.php?p=62488#p62488 by hto @13 Jul 2009]<br />
<br />
===SVN how-to links===<br />
* [http://subversion.apache.org/faq.html] found through google [svn through proxy]<br />
* [http://www.mikepot.com/1544.html], same<br />
* SVN book: [http://svn.zen-cart.org.ua/documentation/en/book/svn-book.html Version Control with Subversion 1.2]<br />
** [http://svn.zen-cart.org.ua/documentation/ru/book/ Same SVN guide, russian]</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna.&diff=36272User:Mna.2015-01-02T01:13:26Z<p>Mna.: /* ReactOS bootCD and liveCD repositories */</p>
<hr />
<div>My patches to ReactOS// My Bookmarks with useful info// Future place for Manifest-like texts.<br />
<br />
==My Patches/WIP==<br />
''(WIP = Work in Progress)''<br />
* [Done] dmesg/kmesg command in ReactOS native kernel debugger [http://jira.reactos.org/browse/CORE-5452 CORE-5452], described there.<br />
** --<br />
* [Done/not-included] dmesg.exe User-mode utility: done. but not applied (.rbuild system was broken/removed then at the moment + 3 month delay of community considering accepting my kmesg patch).<br />
* [Almost done:forming a patch] (Important thing): MMIO for serial card at kernel early-boot. <del>(MMIO serial cards doesn't work at all in ROS.)</del><br />
** Now it works but I don't know how I will test this on real hardware with [http://jira.reactos.org/browse/CORE-8062 CORE-8062] bug leaving the computer in non-working state after every restart and turn-off.<br />
* [Done] micropatch: print CPUs count and available RAM at ROS start (work related with low-memory related bug)<br />
* (..describe later..: partitions' bug, FAT32-moved-root-node, etc)<br />
* usetup.c - series: [http://jira.reactos.org/browse/CORE-7969 CORE-7969] submitted patch at 08.03.2014: will see how long it will stay not applied. (needed to retest new hanges required by multilanguage support; will do after early-Serial-MMIO)<br />
<br />
==Issues: Reported and not yet==<br />
* [http://jira.reactos.org/browse/CORE-7978 CORE-7978] - ReactOS boot code of MBR can't boot USB-HDD due to error reading sectors with int13h_ah=42h<br />
** Added there link to very good explanation how does GRUB stage1 loader work! Just an amazingly detailed description (and also even with joke in stage2!) [http://thestarman.pcministry.com/asm/mbr/GRUB.htm This] link.<br />
** Workaround: use grub-2 to load freeldr.sys<br />
** freeldr.ini also requires editing the rdisk() parameter addressing the disks:<br />
SystemPath=multi(0)disk(0)rdisk(1)partition(2)\ReactOS<br />
<br />
rdisk(1)partition(2) here means: 2nd disk, 2nd partition. (partitions are 1-counted, rdisks - 0-counted.)<br />
<br />
* [Yet old bug of 2010/11 times until now] (On my machine: AcerAspire5920g) ReactOS loading process stuck on line ...\Drivers\DISK.SYS when Disk operation mode in BIOS is set to AHCI. Changed the mode to IDE "workarounds" the problem: ntoskrnl.exe reaches the last line ...\Drivers\NDIS.SYS -- and is stuck somewhere more later -- eating 100% CPU. (//Debug-log is required)<br />
So the summary: SATA2 is not fully supported by ReactOS, forced to use IDE.<br />
<br />
* [http://jira.reactos.org/browse/CORE-8062 CORE-8062] Nasty bug made me thing my laptop monitor (matrix chip) or videocard goes fried with some code of reactos; Luckily it was just wrong settings somewhere there. Unhealthy bug; leaves bad mood on any tester, it needed to be corrected by any mean.<br />
<br />
==Bookmarks on Topics ==<br />
Interesting topics, links (Started at 2011-04-03)<br />
<br />
Here I will keep links to forum topics, wiki pages or other, that seemed to be interesting:<br />
<br />
====(Generic) Development====<br />
* [irc://irc.freenode.net/reactos #reactos] - For general discussion and user support, most people are here<br />
* [http://jira.reactos.org/issues/?filter=-4 All issues of ReactOS] [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20ORDER%20BY%20createdDate%20DESC bugs only]<br />
* [[Missing ReactOS Functionality]] - major things absent of ROS from User PoV<br />
* [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20ORDER%20BY%20priority%20DESC%2C%20createdDate%20DESC Sorted by importance (''priority'' now in JIRA) bugs of ReactOS], except of resolved ones<br />
<br />
* [http://www.reactos.org/wiki/How_PnP_Works_in_ReactOS How PnP Works in ReactOS]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8459 ReactOS, how much money it requires?] - here is only the idea, to be converted to become more correct: "How many man-months?", given man-month is more like a myth, reconsider on per-project basis<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8126 HOWTO Become a Reactos Programmer?] - forum topic, could be converted to more constructive instruction<br />
* [http://dslab.epfl.ch/proj/reveng RevEng: Device Driver Reverse Engineering] from [http://www.reactos.org/forum/viewtopic.php?f=9&t=7990 here]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8206 Command-line-only Win32 from ReactOS?] The topic about full OS without GUI ("headless"?).<br />
** Resembles me idea of [http://hex.pp.ua/nt-native-applications-shell-eng.php Windows/ReactOS Native Shell]) ([http://www.reactos.org/forum/viewtopic.php?f=11&t=9092 Russian]).<br />
<br />
====bootCD and liveCD repositories====<br />
* [http://iso.reactos.org/bootcd/ bootcd repository] iso.reactos.org bootcd images<br />
* [http://iso.reactos.org/livecd/ livecd repository]<br />
<br />
====ReactOS startup procedure described (partly) ====<br />
* [[Modify the final ISO image]] - good article, have also notes on how (bootcd) final CD-image is composed -- i.e. CD directory structure <br />
* [[FreeLoader]] details<br />
* [[User:Mna./FreeLoader,_bootcd_and_bootrecords#FreeLoader_freeldr_Architecture|freeldr Architecture]] and related ReactOS startup steps:<br />
* [[User:Mna./FreeLoader,_bootcd_and_bootrecords|bootcd and bootrecords]]<br />
* [http://en.wikipedia.org/wiki/Windows_NT_Startup_Process Windows NT Startup Process/ Sequence]<br />
* [[User:Mna./ReactOS startup process light summary]]<br />
* [[How the system Finds and Loads Drivers]]<br />
<br />
==== ROS build system hands-on ====<br />
* [[Building_Modules#List_available_ninja_targets|available ninja targets]]<br />
* [[Building_Modules#Removing_or_Updating_a_Module|Updating a module code]] -- do this when the ROS module code was changed and build system didn't notice<br />
* Strange thing become clear; Ctrl+D doesn't work in 1st stage setup.<br />
BootOptions=DbgOsLoadOptions = "/NOGUIBOOT /DEBUGPORT=COM:io,0x3f8,115200n8 /DEBUGPORT=SCREEN" See also [[User:Mna./FreeLoader_freeldr_Architecture#Specifing_Boot_Options|Specifing Boot kernel Options]] ((Not confuse it with [[Boot_options#Options|Boot Options]]))<br />
<br />
====Filesystems generic====<br />
* [[File Systems]], a good page<br />
<br />
====Editing ReactOS registry offline====<br />
From [http://www.reactos.org/forum/viewtopic.php?t=3162 here]<br />
{| class="wikitable"<br />
|-<br />
| <br />
Editing ReactOS registry hives outside ReactOS?<br />
--2006-12<br />
<br />
> Is it possible at this moment to edit the registry hives outside the ReactOS environment?<br />
> I wanted to automate a process to load these registry hives onto the local registry, <br />
> add all my changes, unload the hives and create a new ISO.<br />
<br />
Simply change registry sources and build your own binary hives from them.<br />
<br />
by hto <br/><br />
<br />
> I guess "make" is the prefered way, there isn't any other method for creating these hives?<br /><br />
<br />
There is hive maker in tools\mkhive. You can build it with mingw32-make.exe mkhive<br />
<br />
Copy it from output-i386\tools\mkhive\mkhive.exe to (say) Windows\mkhive.exe.<br />
Then run this command:<br />
<br />
mkhive.exe boot\bootdata output-i386\livecd\reactos\system32\config boot\bootdata\livecd.inf boot\bootdata\hiveinst.inf<br />
<br />
Where output-i386\livecd\reactos\system32\config -- is output folder for hives.<br />
This is how ''make livecd'' does it.<br />
And yes, you can add your foo.inf to the end of that command.<br />
|}<br />
<br />
====NTFS====<br />
* post about [http://www.reactos.org/forum/viewtopic.php?f=9&t=8180#p71875 FUSE-lib creation attempts in ROS] in the "[http://www.reactos.org/forum/viewtopic.php?f=9&t=8180 NTFS question]" topic<br />
* (ru) [http://www.reactos.org/forum/viewtopic.php?f=11&t=8606 NTFS-3G applied to ROS], with ''unixed'' 's idea how to integrate into the '''fuse4win''' or '''dokan'''<br />
<br />
====Misc====<br />
* [http://jira.reactos.org/browse/CORE-8059 Possible solution for Intel's HDA] Audio, high-definition audio<br />
* [http://alter.org.ua/soft/win/uni_ata/ UniATA] project of Alter<br />
* [http://alter.org.ua/en/soft/win/vidcontrol/ Display Control for Windows], Alter's site; Now part of [http://alter.org.ua/en/soft/win/uictl/ UI ctl]<br />
<br />
===Serial extension card and MMIO programming===<br />
* [https://android.googlesource.com/kernel/omap/+/glass-omap-xrr02/drivers/tty/serial/8250_early.c android kernel driver tty-serial 8250_early.c] : as serial debug interface, Android can specify not only IO-ports, but also MMIO and MMIO32 addresses. The "shentek" serial card which I own, requires such communication method, it is based on Oxford chip and gives only mmio interface.<br />
* MMIO [http://en.wikipedia.org/wiki/Memory-mapped_I/O MMIO = Memory-mapped_I/O] Linux:[http://nouveau.freedesktop.org/wiki/MmioTrace/ MmioTrace Home] [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/trace/mmiotrace.txt mmiotrace doc]<br />
<br />
**'''Note: I have much info/hands-on to add here...'''<br />
<br />
===Debug prints in ROS===<br />
* [http://alter.org.ua/docs/nt_kernel/kdprint/ KdPrint/DbgPrint and OutputDebugString behavior] at Alter's site,<br />
* [http://www.codeproject.com/KB/winsdk/OutputDebugString.aspx?display=Print Mechanism of OutputDebugString - CodeProject] the ready code sample,<br />
They (articles) discuss internals and mechanism of OutputDebugString. Definitely Windows too (as unices) uses system calls to store and receive debug messages data to/from kernel debug messages buffer.<br />
<br />
** [http://www.reactos.org/wiki/Enable_kernel_tracing ROS: Enable kernel tracing]<br />
<br />
<br />
====Unix dmesg Internals Analysis====<br />
''for comparison and for creating something equivalent/analogous in ROS''<br />
Shortly:<br />
*'''Linux''' has special system call "'''syslog'''" (man 2 syslog)<br />
*'''FreeBSD''' uses its special '''sysctl''' interface to kernel along with "'''kern.msgbuf'''" parameter.<br />
<br />
'''D'''o we need special system call like Linux, or even more, the whole<br />
family of them (sysctl('*')) as in BSD?<br />
How to implement simple system call for it, now?<br />
<br />
---<br />
<br />
Detailed info for unices:<br />
<br />
'''Linux case''':<br />
* syslog(2) - read and/or clear kernel message ring buffer; set console_loglevel<br />
int syslog(int type, char *bufp, int len);<br />
* also /proc/kmsg virtual file, which when being read returns buffer contents<br />
<br />
Excerpt from "man proc":<br />
<pre><br />
/proc/kmsg<br />
This file can be used instead of the syslog(2) system<br />
call to read kernel messages. A<br />
process must have superuser privileges to read this<br />
file, and only one process should read<br />
this file. This file should not be read if a syslog<br />
process is running which uses the sys‐<br />
log(2) system call facility to log kernel messages.<br />
<br />
Information in this file is retrieved with the dmesg(1) program.<br />
</pre><br />
<br />
'''dmesg in FreeBSD''':<br />
*Parameter 'kern.msgbuf' given to sysctl(3) returns contents of kernel message buffer.<br />
*There is also 'kern.msgbuf_clear' to clean the buffer.<br />
<br />
<br />
====/*USB====<br />
These could be probably outdated in sense the USB now is in better working state.<br />
* [http://wiki.osdev.org/Main osdev.org wiki] - main page, [http://wiki.osdev.org/USB USB, the same place]<br />
* USB for NT4:<br />
** Alter's site reviews: [http://alter.org.ua/en/docs/win/nt4_usb/ en], [http://alter.org.ua/ru/docs/win/nt4_usb/ ru]<br />
** Woodheads opensource(!), GPL USB driver: [ftp://piekraste.daba.lv/pub/Service_Pack/NT_4/NT4_USB/HS/ files backed up] [http://www.geocities.com/mypublic99/index.html "Woodhead--NT4--USB" original link (dead)]<br />
** [http://nt4ref.zcm.com.au/usb.htm Windows NT 4.0 and USB] Quote: "Conclusion: I wish people would stop making comments like 'USB is not supported under NT4' - If you must comment please make it accurate, example: 'Microsoft have made the commercial decision not to provide NT4 USB support - but some manufacturers provide support for specific USB devices on NT4.'"<br />
<br />
====*/====<br />
<br />
<br />
=== FreeLoader, debug information, getting===<br />
Related with low-memory bug: 1) 4Gb was recognized as 25Mb 2) ROS started with 25Mb silently eat up 100% CPU and infinitely read from boot CD/HDD.<br />
* Debugging the FreeLdr: [http://jira.reactos.org/secure/attachment/16335/freeldr.patch freeldr.patch turning on debug mode] from [http://jira.reactos.org/browse/CORE-5462 CORE-5462] -- patch by ''rafalh''<br />
* [[FreeLoader]]<br />
<br />
Misc...<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=7915#p68991 by gabrielilardi @ 20 Jan 2010, forum of ROS]<br />
* [http://www.reactos.org/forum/viewtopic.php?p=62488#p62488 by hto @13 Jul 2009]<br />
<br />
===SVN how-to links===<br />
* [http://subversion.apache.org/faq.html] found through google [svn through proxy]<br />
* [http://www.mikepot.com/1544.html], same<br />
* SVN book: [http://svn.zen-cart.org.ua/documentation/en/book/svn-book.html Version Control with Subversion 1.2]<br />
** [http://svn.zen-cart.org.ua/documentation/ru/book/ Same SVN guide, russian]</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna.&diff=36271User:Mna.2015-01-02T00:50:11Z<p>Mna.: /* Bookmarks on Topics */</p>
<hr />
<div>My patches to ReactOS// My Bookmarks with useful info// Future place for Manifest-like texts.<br />
<br />
==My Patches/WIP==<br />
''(WIP = Work in Progress)''<br />
* [Done] dmesg/kmesg command in ReactOS native kernel debugger [http://jira.reactos.org/browse/CORE-5452 CORE-5452], described there.<br />
** --<br />
* [Done/not-included] dmesg.exe User-mode utility: done. but not applied (.rbuild system was broken/removed then at the moment + 3 month delay of community considering accepting my kmesg patch).<br />
* [Almost done:forming a patch] (Important thing): MMIO for serial card at kernel early-boot. <del>(MMIO serial cards doesn't work at all in ROS.)</del><br />
** Now it works but I don't know how I will test this on real hardware with [http://jira.reactos.org/browse/CORE-8062 CORE-8062] bug leaving the computer in non-working state after every restart and turn-off.<br />
* [Done] micropatch: print CPUs count and available RAM at ROS start (work related with low-memory related bug)<br />
* (..describe later..: partitions' bug, FAT32-moved-root-node, etc)<br />
* usetup.c - series: [http://jira.reactos.org/browse/CORE-7969 CORE-7969] submitted patch at 08.03.2014: will see how long it will stay not applied. (needed to retest new hanges required by multilanguage support; will do after early-Serial-MMIO)<br />
<br />
==Issues: Reported and not yet==<br />
* [http://jira.reactos.org/browse/CORE-7978 CORE-7978] - ReactOS boot code of MBR can't boot USB-HDD due to error reading sectors with int13h_ah=42h<br />
** Added there link to very good explanation how does GRUB stage1 loader work! Just an amazingly detailed description (and also even with joke in stage2!) [http://thestarman.pcministry.com/asm/mbr/GRUB.htm This] link.<br />
** Workaround: use grub-2 to load freeldr.sys<br />
** freeldr.ini also requires editing the rdisk() parameter addressing the disks:<br />
SystemPath=multi(0)disk(0)rdisk(1)partition(2)\ReactOS<br />
<br />
rdisk(1)partition(2) here means: 2nd disk, 2nd partition. (partitions are 1-counted, rdisks - 0-counted.)<br />
<br />
* [Yet old bug of 2010/11 times until now] (On my machine: AcerAspire5920g) ReactOS loading process stuck on line ...\Drivers\DISK.SYS when Disk operation mode in BIOS is set to AHCI. Changed the mode to IDE "workarounds" the problem: ntoskrnl.exe reaches the last line ...\Drivers\NDIS.SYS -- and is stuck somewhere more later -- eating 100% CPU. (//Debug-log is required)<br />
So the summary: SATA2 is not fully supported by ReactOS, forced to use IDE.<br />
<br />
* [http://jira.reactos.org/browse/CORE-8062 CORE-8062] Nasty bug made me thing my laptop monitor (matrix chip) or videocard goes fried with some code of reactos; Luckily it was just wrong settings somewhere there. Unhealthy bug; leaves bad mood on any tester, it needed to be corrected by any mean.<br />
<br />
==Bookmarks on Topics ==<br />
Interesting topics, links (Started at 2011-04-03)<br />
<br />
Here I will keep links to forum topics, wiki pages or other, that seemed to be interesting:<br />
<br />
====(Generic) Development====<br />
* [irc://irc.freenode.net/reactos #reactos] - For general discussion and user support, most people are here<br />
* [http://jira.reactos.org/issues/?filter=-4 All issues of ReactOS] [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20ORDER%20BY%20createdDate%20DESC bugs only]<br />
* [[Missing ReactOS Functionality]] - major things absent of ROS from User PoV<br />
* [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20ORDER%20BY%20priority%20DESC%2C%20createdDate%20DESC Sorted by importance (''priority'' now in JIRA) bugs of ReactOS], except of resolved ones<br />
<br />
* [http://www.reactos.org/wiki/How_PnP_Works_in_ReactOS How PnP Works in ReactOS]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8459 ReactOS, how much money it requires?] - here is only the idea, to be converted to become more correct: "How many man-months?", given man-month is more like a myth, reconsider on per-project basis<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8126 HOWTO Become a Reactos Programmer?] - forum topic, could be converted to more constructive instruction<br />
* [http://dslab.epfl.ch/proj/reveng RevEng: Device Driver Reverse Engineering] from [http://www.reactos.org/forum/viewtopic.php?f=9&t=7990 here]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8206 Command-line-only Win32 from ReactOS?] The topic about full OS without GUI ("headless"?).<br />
** Resembles me idea of [http://hex.pp.ua/nt-native-applications-shell-eng.php Windows/ReactOS Native Shell]) ([http://www.reactos.org/forum/viewtopic.php?f=11&t=9092 Russian]).<br />
<br />
====ReactOS bootCD and liveCD repositories====<br />
* [http://iso.reactos.org/bootcd/ bootcd repository] iso.reactos.org bootcd images<br />
* [http://iso.reactos.org/livecd/ livecd repository]<br />
<br />
====ReactOS startup procedure described (partly) ====<br />
* [[Modify the final ISO image]] - good article, have also notes on how (bootcd) final CD-image is composed -- i.e. CD directory structure <br />
* [[FreeLoader]] details<br />
* [[User:Mna./FreeLoader,_bootcd_and_bootrecords#FreeLoader_freeldr_Architecture|freeldr Architecture]] and related ReactOS startup steps:<br />
* [[User:Mna./FreeLoader,_bootcd_and_bootrecords|bootcd and bootrecords]]<br />
* [http://en.wikipedia.org/wiki/Windows_NT_Startup_Process Windows NT Startup Process/ Sequence]<br />
* [[User:Mna./ReactOS startup process light summary]]<br />
* [[How the system Finds and Loads Drivers]]<br />
<br />
==== ROS build system hands-on ====<br />
* [[Building_Modules#List_available_ninja_targets|available ninja targets]]<br />
* [[Building_Modules#Removing_or_Updating_a_Module|Updating a module code]] -- do this when the ROS module code was changed and build system didn't notice<br />
* Strange thing become clear; Ctrl+D doesn't work in 1st stage setup.<br />
BootOptions=DbgOsLoadOptions = "/NOGUIBOOT /DEBUGPORT=COM:io,0x3f8,115200n8 /DEBUGPORT=SCREEN" See also [[User:Mna./FreeLoader_freeldr_Architecture#Specifing_Boot_Options|Specifing Boot kernel Options]] ((Not confuse it with [[Boot_options#Options|Boot Options]]))<br />
<br />
====Filesystems generic====<br />
* [[File Systems]], a good page<br />
<br />
====Editing ReactOS registry offline====<br />
From [http://www.reactos.org/forum/viewtopic.php?t=3162 here]<br />
{| class="wikitable"<br />
|-<br />
| <br />
Editing ReactOS registry hives outside ReactOS?<br />
--2006-12<br />
<br />
> Is it possible at this moment to edit the registry hives outside the ReactOS environment?<br />
> I wanted to automate a process to load these registry hives onto the local registry, <br />
> add all my changes, unload the hives and create a new ISO.<br />
<br />
Simply change registry sources and build your own binary hives from them.<br />
<br />
by hto <br/><br />
<br />
> I guess "make" is the prefered way, there isn't any other method for creating these hives?<br /><br />
<br />
There is hive maker in tools\mkhive. You can build it with mingw32-make.exe mkhive<br />
<br />
Copy it from output-i386\tools\mkhive\mkhive.exe to (say) Windows\mkhive.exe.<br />
Then run this command:<br />
<br />
mkhive.exe boot\bootdata output-i386\livecd\reactos\system32\config boot\bootdata\livecd.inf boot\bootdata\hiveinst.inf<br />
<br />
Where output-i386\livecd\reactos\system32\config -- is output folder for hives.<br />
This is how ''make livecd'' does it.<br />
And yes, you can add your foo.inf to the end of that command.<br />
|}<br />
<br />
====NTFS====<br />
* post about [http://www.reactos.org/forum/viewtopic.php?f=9&t=8180#p71875 FUSE-lib creation attempts in ROS] in the "[http://www.reactos.org/forum/viewtopic.php?f=9&t=8180 NTFS question]" topic<br />
* (ru) [http://www.reactos.org/forum/viewtopic.php?f=11&t=8606 NTFS-3G applied to ROS], with ''unixed'' 's idea how to integrate into the '''fuse4win''' or '''dokan'''<br />
<br />
====Misc====<br />
* [http://jira.reactos.org/browse/CORE-8059 Possible solution for Intel's HDA] Audio, high-definition audio<br />
* [http://alter.org.ua/soft/win/uni_ata/ UniATA] project of Alter<br />
* [http://alter.org.ua/en/soft/win/vidcontrol/ Display Control for Windows], Alter's site; Now part of [http://alter.org.ua/en/soft/win/uictl/ UI ctl]<br />
<br />
===Serial extension card and MMIO programming===<br />
* [https://android.googlesource.com/kernel/omap/+/glass-omap-xrr02/drivers/tty/serial/8250_early.c android kernel driver tty-serial 8250_early.c] : as serial debug interface, Android can specify not only IO-ports, but also MMIO and MMIO32 addresses. The "shentek" serial card which I own, requires such communication method, it is based on Oxford chip and gives only mmio interface.<br />
* MMIO [http://en.wikipedia.org/wiki/Memory-mapped_I/O MMIO = Memory-mapped_I/O] Linux:[http://nouveau.freedesktop.org/wiki/MmioTrace/ MmioTrace Home] [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/trace/mmiotrace.txt mmiotrace doc]<br />
<br />
**'''Note: I have much info/hands-on to add here...'''<br />
<br />
===Debug prints in ROS===<br />
* [http://alter.org.ua/docs/nt_kernel/kdprint/ KdPrint/DbgPrint and OutputDebugString behavior] at Alter's site,<br />
* [http://www.codeproject.com/KB/winsdk/OutputDebugString.aspx?display=Print Mechanism of OutputDebugString - CodeProject] the ready code sample,<br />
They (articles) discuss internals and mechanism of OutputDebugString. Definitely Windows too (as unices) uses system calls to store and receive debug messages data to/from kernel debug messages buffer.<br />
<br />
** [http://www.reactos.org/wiki/Enable_kernel_tracing ROS: Enable kernel tracing]<br />
<br />
<br />
====Unix dmesg Internals Analysis====<br />
''for comparison and for creating something equivalent/analogous in ROS''<br />
Shortly:<br />
*'''Linux''' has special system call "'''syslog'''" (man 2 syslog)<br />
*'''FreeBSD''' uses its special '''sysctl''' interface to kernel along with "'''kern.msgbuf'''" parameter.<br />
<br />
'''D'''o we need special system call like Linux, or even more, the whole<br />
family of them (sysctl('*')) as in BSD?<br />
How to implement simple system call for it, now?<br />
<br />
---<br />
<br />
Detailed info for unices:<br />
<br />
'''Linux case''':<br />
* syslog(2) - read and/or clear kernel message ring buffer; set console_loglevel<br />
int syslog(int type, char *bufp, int len);<br />
* also /proc/kmsg virtual file, which when being read returns buffer contents<br />
<br />
Excerpt from "man proc":<br />
<pre><br />
/proc/kmsg<br />
This file can be used instead of the syslog(2) system<br />
call to read kernel messages. A<br />
process must have superuser privileges to read this<br />
file, and only one process should read<br />
this file. This file should not be read if a syslog<br />
process is running which uses the sys‐<br />
log(2) system call facility to log kernel messages.<br />
<br />
Information in this file is retrieved with the dmesg(1) program.<br />
</pre><br />
<br />
'''dmesg in FreeBSD''':<br />
*Parameter 'kern.msgbuf' given to sysctl(3) returns contents of kernel message buffer.<br />
*There is also 'kern.msgbuf_clear' to clean the buffer.<br />
<br />
<br />
====/*USB====<br />
These could be probably outdated in sense the USB now is in better working state.<br />
* [http://wiki.osdev.org/Main osdev.org wiki] - main page, [http://wiki.osdev.org/USB USB, the same place]<br />
* USB for NT4:<br />
** Alter's site reviews: [http://alter.org.ua/en/docs/win/nt4_usb/ en], [http://alter.org.ua/ru/docs/win/nt4_usb/ ru]<br />
** Woodheads opensource(!), GPL USB driver: [ftp://piekraste.daba.lv/pub/Service_Pack/NT_4/NT4_USB/HS/ files backed up] [http://www.geocities.com/mypublic99/index.html "Woodhead--NT4--USB" original link (dead)]<br />
** [http://nt4ref.zcm.com.au/usb.htm Windows NT 4.0 and USB] Quote: "Conclusion: I wish people would stop making comments like 'USB is not supported under NT4' - If you must comment please make it accurate, example: 'Microsoft have made the commercial decision not to provide NT4 USB support - but some manufacturers provide support for specific USB devices on NT4.'"<br />
<br />
====*/====<br />
<br />
<br />
=== FreeLoader, debug information, getting===<br />
Related with low-memory bug: 1) 4Gb was recognized as 25Mb 2) ROS started with 25Mb silently eat up 100% CPU and infinitely read from boot CD/HDD.<br />
* Debugging the FreeLdr: [http://jira.reactos.org/secure/attachment/16335/freeldr.patch freeldr.patch turning on debug mode] from [http://jira.reactos.org/browse/CORE-5462 CORE-5462] -- patch by ''rafalh''<br />
* [[FreeLoader]]<br />
<br />
Misc...<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=7915#p68991 by gabrielilardi @ 20 Jan 2010, forum of ROS]<br />
* [http://www.reactos.org/forum/viewtopic.php?p=62488#p62488 by hto @13 Jul 2009]<br />
<br />
===SVN how-to links===<br />
* [http://subversion.apache.org/faq.html] found through google [svn through proxy]<br />
* [http://www.mikepot.com/1544.html], same<br />
* SVN book: [http://svn.zen-cart.org.ua/documentation/en/book/svn-book.html Version Control with Subversion 1.2]<br />
** [http://svn.zen-cart.org.ua/documentation/ru/book/ Same SVN guide, russian]</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna.&diff=36270User:Mna.2015-01-02T00:46:53Z<p>Mna.: /* ReactOS startup descriptions */</p>
<hr />
<div>My patches to ReactOS// My Bookmarks with useful info// Future place for Manifest-like texts.<br />
<br />
==My Patches/WIP==<br />
''(WIP = Work in Progress)''<br />
* [Done] dmesg/kmesg command in ReactOS native kernel debugger [http://jira.reactos.org/browse/CORE-5452 CORE-5452], described there.<br />
** --<br />
* [Done/not-included] dmesg.exe User-mode utility: done. but not applied (.rbuild system was broken/removed then at the moment + 3 month delay of community considering accepting my kmesg patch).<br />
* [Almost done:forming a patch] (Important thing): MMIO for serial card at kernel early-boot. <del>(MMIO serial cards doesn't work at all in ROS.)</del><br />
** Now it works but I don't know how I will test this on real hardware with [http://jira.reactos.org/browse/CORE-8062 CORE-8062] bug leaving the computer in non-working state after every restart and turn-off.<br />
* [Done] micropatch: print CPUs count and available RAM at ROS start (work related with low-memory related bug)<br />
* (..describe later..: partitions' bug, FAT32-moved-root-node, etc)<br />
* usetup.c - series: [http://jira.reactos.org/browse/CORE-7969 CORE-7969] submitted patch at 08.03.2014: will see how long it will stay not applied. (needed to retest new hanges required by multilanguage support; will do after early-Serial-MMIO)<br />
<br />
==Issues: Reported and not yet==<br />
* [http://jira.reactos.org/browse/CORE-7978 CORE-7978] - ReactOS boot code of MBR can't boot USB-HDD due to error reading sectors with int13h_ah=42h<br />
** Added there link to very good explanation how does GRUB stage1 loader work! Just an amazingly detailed description (and also even with joke in stage2!) [http://thestarman.pcministry.com/asm/mbr/GRUB.htm This] link.<br />
** Workaround: use grub-2 to load freeldr.sys<br />
** freeldr.ini also requires editing the rdisk() parameter addressing the disks:<br />
SystemPath=multi(0)disk(0)rdisk(1)partition(2)\ReactOS<br />
<br />
rdisk(1)partition(2) here means: 2nd disk, 2nd partition. (partitions are 1-counted, rdisks - 0-counted.)<br />
<br />
* [Yet old bug of 2010/11 times until now] (On my machine: AcerAspire5920g) ReactOS loading process stuck on line ...\Drivers\DISK.SYS when Disk operation mode in BIOS is set to AHCI. Changed the mode to IDE "workarounds" the problem: ntoskrnl.exe reaches the last line ...\Drivers\NDIS.SYS -- and is stuck somewhere more later -- eating 100% CPU. (//Debug-log is required)<br />
So the summary: SATA2 is not fully supported by ReactOS, forced to use IDE.<br />
<br />
* [http://jira.reactos.org/browse/CORE-8062 CORE-8062] Nasty bug made me thing my laptop monitor (matrix chip) or videocard goes fried with some code of reactos; Luckily it was just wrong settings somewhere there. Unhealthy bug; leaves bad mood on any tester, it needed to be corrected by any mean.<br />
<br />
==Bookmarks on Topics ==<br />
Interesting topics, links (Started at 2011-04-03)<br />
<br />
Here I will keep links to forum topics, wiki pages or other, that seemed to be interesting:<br />
<br />
====(Generic) Development====<br />
* [irc://irc.freenode.net/reactos #reactos] - For general discussion and user support, most people are here<br />
* [http://jira.reactos.org/issues/?filter=-4 All issues of ReactOS] [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20ORDER%20BY%20createdDate%20DESC bugs only]<br />
* [[Missing ReactOS Functionality]] - major things absent of ROS from User PoV<br />
* [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20ORDER%20BY%20priority%20DESC%2C%20createdDate%20DESC Sorted by importance (''priority'' now in JIRA) bugs of ReactOS], except of resolved ones<br />
<br />
* [http://www.reactos.org/wiki/How_PnP_Works_in_ReactOS How PnP Works in ReactOS]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8459 ReactOS, how much money it requires?] - here is only the idea, to be converted to become more correct: "How many man-months?", given man-month is more like a myth, reconsider on per-project basis<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8126 HOWTO Become a Reactos Programmer?] - forum topic, could be converted to more constructive instruction<br />
* [http://dslab.epfl.ch/proj/reveng RevEng: Device Driver Reverse Engineering] from [http://www.reactos.org/forum/viewtopic.php?f=9&t=7990 here]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8206 Command-line-only Win32 from ReactOS?] The topic about full OS without GUI ("headless"?).<br />
** Resembles me idea of [http://hex.pp.ua/nt-native-applications-shell-eng.php Windows/ReactOS Native Shell]) ([http://www.reactos.org/forum/viewtopic.php?f=11&t=9092 Russian]).<br />
<br />
====ReactOS startup : bootCD, liveCD, CD directory structure ====<br />
* [[Modify the final ISO image]] - good article, have also notes on how (bootcd) final CD-image is composed<br />
* [http://iso.reactos.org/bootcd/ bootcd repository] iso.reactos.org bootcd images<br />
* [http://iso.reactos.org/livecd/ livecd repository]<br />
<br />
====ReactOS startup procedure described (partly) ====<br />
* [[FreeLoader]], details, <br />
* [[User:Mna./FreeLoader,_bootcd_and_bootrecords#FreeLoader_freeldr_Architecture|freeldr Architecture]] and related startup steps: <br />
* [[User:Mna./FreeLoader,_bootcd_and_bootrecords|bootcd and bootrecords]]<br />
* [http://en.wikipedia.org/wiki/Windows_NT_Startup_Process Windows NT Startup Process/ Sequence]<br />
* [[User:Mna./ReactOS startup process light summary]]<br />
* [[How the system Finds and Loads Drivers]]<br />
<br />
==== ROS build system hands-on ====<br />
* [[Building_Modules#List_available_ninja_targets|available ninja targets]]<br />
* [[Building_Modules#Removing_or_Updating_a_Module|Updating a module code]] -- do this when the ROS module code was changed and build system didn't notice<br />
* Strange thing become clear; Ctrl+D doesn't work in 1st stage setup.<br />
BootOptions=DbgOsLoadOptions = "/NOGUIBOOT /DEBUGPORT=COM:io,0x3f8,115200n8 /DEBUGPORT=SCREEN" See also [[User:Mna./FreeLoader_freeldr_Architecture#Specifing_Boot_Options|Specifing Boot kernel Options]] ((Not confuse it with [[Boot_options#Options|Boot Options]]))<br />
<br />
====Filesystems generic====<br />
* [[File Systems]], a good page<br />
<br />
====Editing ReactOS registry offline====<br />
From [http://www.reactos.org/forum/viewtopic.php?t=3162 here]<br />
{| class="wikitable"<br />
|-<br />
| <br />
Editing ReactOS registry hives outside ReactOS?<br />
--2006-12<br />
<br />
> Is it possible at this moment to edit the registry hives outside the ReactOS environment?<br />
> I wanted to automate a process to load these registry hives onto the local registry, <br />
> add all my changes, unload the hives and create a new ISO.<br />
<br />
Simply change registry sources and build your own binary hives from them.<br />
<br />
by hto <br/><br />
<br />
> I guess "make" is the prefered way, there isn't any other method for creating these hives?<br /><br />
<br />
There is hive maker in tools\mkhive. You can build it with mingw32-make.exe mkhive<br />
<br />
Copy it from output-i386\tools\mkhive\mkhive.exe to (say) Windows\mkhive.exe.<br />
Then run this command:<br />
<br />
mkhive.exe boot\bootdata output-i386\livecd\reactos\system32\config boot\bootdata\livecd.inf boot\bootdata\hiveinst.inf<br />
<br />
Where output-i386\livecd\reactos\system32\config -- is output folder for hives.<br />
This is how ''make livecd'' does it.<br />
And yes, you can add your foo.inf to the end of that command.<br />
|}<br />
<br />
====NTFS====<br />
* post about [http://www.reactos.org/forum/viewtopic.php?f=9&t=8180#p71875 FUSE-lib creation attempts in ROS] in the "[http://www.reactos.org/forum/viewtopic.php?f=9&t=8180 NTFS question]" topic<br />
* (ru) [http://www.reactos.org/forum/viewtopic.php?f=11&t=8606 NTFS-3G applied to ROS], with ''unixed'' 's idea how to integrate into the '''fuse4win''' or '''dokan'''<br />
<br />
====Misc====<br />
* [http://jira.reactos.org/browse/CORE-8059 Possible solution for Intel's HDA] Audio, high-definition audio<br />
* [http://alter.org.ua/soft/win/uni_ata/ UniATA] project of Alter<br />
* [http://alter.org.ua/en/soft/win/vidcontrol/ Display Control for Windows], Alter's site; Now part of [http://alter.org.ua/en/soft/win/uictl/ UI ctl]<br />
<br />
===Serial extension card and MMIO programming===<br />
* [https://android.googlesource.com/kernel/omap/+/glass-omap-xrr02/drivers/tty/serial/8250_early.c android kernel driver tty-serial 8250_early.c] : as serial debug interface, Android can specify not only IO-ports, but also MMIO and MMIO32 addresses. The "shentek" serial card which I own, requires such communication method, it is based on Oxford chip and gives only mmio interface.<br />
* MMIO [http://en.wikipedia.org/wiki/Memory-mapped_I/O MMIO = Memory-mapped_I/O] Linux:[http://nouveau.freedesktop.org/wiki/MmioTrace/ MmioTrace Home] [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/trace/mmiotrace.txt mmiotrace doc]<br />
<br />
**'''Note: I have much info/hands-on to add here...'''<br />
<br />
===Debug prints in ROS===<br />
* [http://alter.org.ua/docs/nt_kernel/kdprint/ KdPrint/DbgPrint and OutputDebugString behavior] at Alter's site,<br />
* [http://www.codeproject.com/KB/winsdk/OutputDebugString.aspx?display=Print Mechanism of OutputDebugString - CodeProject] the ready code sample,<br />
They (articles) discuss internals and mechanism of OutputDebugString. Definitely Windows too (as unices) uses system calls to store and receive debug messages data to/from kernel debug messages buffer.<br />
<br />
** [http://www.reactos.org/wiki/Enable_kernel_tracing ROS: Enable kernel tracing]<br />
<br />
<br />
====Unix dmesg Internals Analysis====<br />
''for comparison and for creating something equivalent/analogous in ROS''<br />
Shortly:<br />
*'''Linux''' has special system call "'''syslog'''" (man 2 syslog)<br />
*'''FreeBSD''' uses its special '''sysctl''' interface to kernel along with "'''kern.msgbuf'''" parameter.<br />
<br />
'''D'''o we need special system call like Linux, or even more, the whole<br />
family of them (sysctl('*')) as in BSD?<br />
How to implement simple system call for it, now?<br />
<br />
---<br />
<br />
Detailed info for unices:<br />
<br />
'''Linux case''':<br />
* syslog(2) - read and/or clear kernel message ring buffer; set console_loglevel<br />
int syslog(int type, char *bufp, int len);<br />
* also /proc/kmsg virtual file, which when being read returns buffer contents<br />
<br />
Excerpt from "man proc":<br />
<pre><br />
/proc/kmsg<br />
This file can be used instead of the syslog(2) system<br />
call to read kernel messages. A<br />
process must have superuser privileges to read this<br />
file, and only one process should read<br />
this file. This file should not be read if a syslog<br />
process is running which uses the sys‐<br />
log(2) system call facility to log kernel messages.<br />
<br />
Information in this file is retrieved with the dmesg(1) program.<br />
</pre><br />
<br />
'''dmesg in FreeBSD''':<br />
*Parameter 'kern.msgbuf' given to sysctl(3) returns contents of kernel message buffer.<br />
*There is also 'kern.msgbuf_clear' to clean the buffer.<br />
<br />
<br />
====/*USB====<br />
These could be probably outdated in sense the USB now is in better working state.<br />
* [http://wiki.osdev.org/Main osdev.org wiki] - main page, [http://wiki.osdev.org/USB USB, the same place]<br />
* USB for NT4:<br />
** Alter's site reviews: [http://alter.org.ua/en/docs/win/nt4_usb/ en], [http://alter.org.ua/ru/docs/win/nt4_usb/ ru]<br />
** Woodheads opensource(!), GPL USB driver: [ftp://piekraste.daba.lv/pub/Service_Pack/NT_4/NT4_USB/HS/ files backed up] [http://www.geocities.com/mypublic99/index.html "Woodhead--NT4--USB" original link (dead)]<br />
** [http://nt4ref.zcm.com.au/usb.htm Windows NT 4.0 and USB] Quote: "Conclusion: I wish people would stop making comments like 'USB is not supported under NT4' - If you must comment please make it accurate, example: 'Microsoft have made the commercial decision not to provide NT4 USB support - but some manufacturers provide support for specific USB devices on NT4.'"<br />
<br />
====*/====<br />
<br />
<br />
=== FreeLoader, debug information, getting===<br />
Related with low-memory bug: 1) 4Gb was recognized as 25Mb 2) ROS started with 25Mb silently eat up 100% CPU and infinitely read from boot CD/HDD.<br />
* Debugging the FreeLdr: [http://jira.reactos.org/secure/attachment/16335/freeldr.patch freeldr.patch turning on debug mode] from [http://jira.reactos.org/browse/CORE-5462 CORE-5462] -- patch by ''rafalh''<br />
* [[FreeLoader]]<br />
<br />
Misc...<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=7915#p68991 by gabrielilardi @ 20 Jan 2010, forum of ROS]<br />
* [http://www.reactos.org/forum/viewtopic.php?p=62488#p62488 by hto @13 Jul 2009]<br />
<br />
===SVN how-to links===<br />
* [http://subversion.apache.org/faq.html] found through google [svn through proxy]<br />
* [http://www.mikepot.com/1544.html], same<br />
* SVN book: [http://svn.zen-cart.org.ua/documentation/en/book/svn-book.html Version Control with Subversion 1.2]<br />
** [http://svn.zen-cart.org.ua/documentation/ru/book/ Same SVN guide, russian]</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna.&diff=36269User:Mna.2015-01-02T00:45:38Z<p>Mna.: /* Bookmarks on Topics */</p>
<hr />
<div>My patches to ReactOS// My Bookmarks with useful info// Future place for Manifest-like texts.<br />
<br />
==My Patches/WIP==<br />
''(WIP = Work in Progress)''<br />
* [Done] dmesg/kmesg command in ReactOS native kernel debugger [http://jira.reactos.org/browse/CORE-5452 CORE-5452], described there.<br />
** --<br />
* [Done/not-included] dmesg.exe User-mode utility: done. but not applied (.rbuild system was broken/removed then at the moment + 3 month delay of community considering accepting my kmesg patch).<br />
* [Almost done:forming a patch] (Important thing): MMIO for serial card at kernel early-boot. <del>(MMIO serial cards doesn't work at all in ROS.)</del><br />
** Now it works but I don't know how I will test this on real hardware with [http://jira.reactos.org/browse/CORE-8062 CORE-8062] bug leaving the computer in non-working state after every restart and turn-off.<br />
* [Done] micropatch: print CPUs count and available RAM at ROS start (work related with low-memory related bug)<br />
* (..describe later..: partitions' bug, FAT32-moved-root-node, etc)<br />
* usetup.c - series: [http://jira.reactos.org/browse/CORE-7969 CORE-7969] submitted patch at 08.03.2014: will see how long it will stay not applied. (needed to retest new hanges required by multilanguage support; will do after early-Serial-MMIO)<br />
<br />
==Issues: Reported and not yet==<br />
* [http://jira.reactos.org/browse/CORE-7978 CORE-7978] - ReactOS boot code of MBR can't boot USB-HDD due to error reading sectors with int13h_ah=42h<br />
** Added there link to very good explanation how does GRUB stage1 loader work! Just an amazingly detailed description (and also even with joke in stage2!) [http://thestarman.pcministry.com/asm/mbr/GRUB.htm This] link.<br />
** Workaround: use grub-2 to load freeldr.sys<br />
** freeldr.ini also requires editing the rdisk() parameter addressing the disks:<br />
SystemPath=multi(0)disk(0)rdisk(1)partition(2)\ReactOS<br />
<br />
rdisk(1)partition(2) here means: 2nd disk, 2nd partition. (partitions are 1-counted, rdisks - 0-counted.)<br />
<br />
* [Yet old bug of 2010/11 times until now] (On my machine: AcerAspire5920g) ReactOS loading process stuck on line ...\Drivers\DISK.SYS when Disk operation mode in BIOS is set to AHCI. Changed the mode to IDE "workarounds" the problem: ntoskrnl.exe reaches the last line ...\Drivers\NDIS.SYS -- and is stuck somewhere more later -- eating 100% CPU. (//Debug-log is required)<br />
So the summary: SATA2 is not fully supported by ReactOS, forced to use IDE.<br />
<br />
* [http://jira.reactos.org/browse/CORE-8062 CORE-8062] Nasty bug made me thing my laptop monitor (matrix chip) or videocard goes fried with some code of reactos; Luckily it was just wrong settings somewhere there. Unhealthy bug; leaves bad mood on any tester, it needed to be corrected by any mean.<br />
<br />
==Bookmarks on Topics ==<br />
Interesting topics, links (Started at 2011-04-03)<br />
<br />
Here I will keep links to forum topics, wiki pages or other, that seemed to be interesting:<br />
<br />
====(Generic) Development====<br />
* [irc://irc.freenode.net/reactos #reactos] - For general discussion and user support, most people are here<br />
* [http://jira.reactos.org/issues/?filter=-4 All issues of ReactOS] [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20ORDER%20BY%20createdDate%20DESC bugs only]<br />
* [[Missing ReactOS Functionality]] - major things absent of ROS from User PoV<br />
* [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20ORDER%20BY%20priority%20DESC%2C%20createdDate%20DESC Sorted by importance (''priority'' now in JIRA) bugs of ReactOS], except of resolved ones<br />
<br />
* [http://www.reactos.org/wiki/How_PnP_Works_in_ReactOS How PnP Works in ReactOS]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8459 ReactOS, how much money it requires?] - here is only the idea, to be converted to become more correct: "How many man-months?", given man-month is more like a myth, reconsider on per-project basis<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8126 HOWTO Become a Reactos Programmer?] - forum topic, could be converted to more constructive instruction<br />
* [http://dslab.epfl.ch/proj/reveng RevEng: Device Driver Reverse Engineering] from [http://www.reactos.org/forum/viewtopic.php?f=9&t=7990 here]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8206 Command-line-only Win32 from ReactOS?] The topic about full OS without GUI ("headless"?).<br />
** Resembles me idea of [http://hex.pp.ua/nt-native-applications-shell-eng.php Windows/ReactOS Native Shell]) ([http://www.reactos.org/forum/viewtopic.php?f=11&t=9092 Russian]).<br />
<br />
====ReactOS startup : bootCD, liveCD, CD directory structure ====<br />
* [[Modify the final ISO image]] - good article, have also notes on how (bootcd) final CD-image is composed<br />
* [http://iso.reactos.org/bootcd/ bootcd repository] iso.reactos.org bootcd images<br />
* [http://iso.reactos.org/livecd/ livecd repository]<br />
<br />
====ReactOS startup descriptions ====<br />
* [[FreeLoader]], details, <br />
* [[User:Mna./FreeLoader,_bootcd_and_bootrecords#FreeLoader_freeldr_Architecture|freeldr Architecture]] and related startup steps: <br />
* [[User:Mna./FreeLoader,_bootcd_and_bootrecords|bootcd and bootrecords]]<br />
* [http://en.wikipedia.org/wiki/Windows_NT_Startup_Process Windows NT Startup Process/ Sequence]<br />
* [[User:Mna./ReactOS startup process light summary]]<br />
* [[How the system Finds and Loads Drivers]]<br />
<br />
==== ROS build system hands-on ====<br />
* [[Building_Modules#List_available_ninja_targets|available ninja targets]]<br />
* [[Building_Modules#Removing_or_Updating_a_Module|Updating a module code]] -- do this when the ROS module code was changed and build system didn't notice<br />
* Strange thing become clear; Ctrl+D doesn't work in 1st stage setup.<br />
BootOptions=DbgOsLoadOptions = "/NOGUIBOOT /DEBUGPORT=COM:io,0x3f8,115200n8 /DEBUGPORT=SCREEN" See also [[User:Mna./FreeLoader_freeldr_Architecture#Specifing_Boot_Options|Specifing Boot kernel Options]] ((Not confuse it with [[Boot_options#Options|Boot Options]]))<br />
<br />
====Filesystems generic====<br />
* [[File Systems]], a good page<br />
<br />
====Editing ReactOS registry offline====<br />
From [http://www.reactos.org/forum/viewtopic.php?t=3162 here]<br />
{| class="wikitable"<br />
|-<br />
| <br />
Editing ReactOS registry hives outside ReactOS?<br />
--2006-12<br />
<br />
> Is it possible at this moment to edit the registry hives outside the ReactOS environment?<br />
> I wanted to automate a process to load these registry hives onto the local registry, <br />
> add all my changes, unload the hives and create a new ISO.<br />
<br />
Simply change registry sources and build your own binary hives from them.<br />
<br />
by hto <br/><br />
<br />
> I guess "make" is the prefered way, there isn't any other method for creating these hives?<br /><br />
<br />
There is hive maker in tools\mkhive. You can build it with mingw32-make.exe mkhive<br />
<br />
Copy it from output-i386\tools\mkhive\mkhive.exe to (say) Windows\mkhive.exe.<br />
Then run this command:<br />
<br />
mkhive.exe boot\bootdata output-i386\livecd\reactos\system32\config boot\bootdata\livecd.inf boot\bootdata\hiveinst.inf<br />
<br />
Where output-i386\livecd\reactos\system32\config -- is output folder for hives.<br />
This is how ''make livecd'' does it.<br />
And yes, you can add your foo.inf to the end of that command.<br />
|}<br />
<br />
====NTFS====<br />
* post about [http://www.reactos.org/forum/viewtopic.php?f=9&t=8180#p71875 FUSE-lib creation attempts in ROS] in the "[http://www.reactos.org/forum/viewtopic.php?f=9&t=8180 NTFS question]" topic<br />
* (ru) [http://www.reactos.org/forum/viewtopic.php?f=11&t=8606 NTFS-3G applied to ROS], with ''unixed'' 's idea how to integrate into the '''fuse4win''' or '''dokan'''<br />
<br />
====Misc====<br />
* [http://jira.reactos.org/browse/CORE-8059 Possible solution for Intel's HDA] Audio, high-definition audio<br />
* [http://alter.org.ua/soft/win/uni_ata/ UniATA] project of Alter<br />
* [http://alter.org.ua/en/soft/win/vidcontrol/ Display Control for Windows], Alter's site; Now part of [http://alter.org.ua/en/soft/win/uictl/ UI ctl]<br />
<br />
===Serial extension card and MMIO programming===<br />
* [https://android.googlesource.com/kernel/omap/+/glass-omap-xrr02/drivers/tty/serial/8250_early.c android kernel driver tty-serial 8250_early.c] : as serial debug interface, Android can specify not only IO-ports, but also MMIO and MMIO32 addresses. The "shentek" serial card which I own, requires such communication method, it is based on Oxford chip and gives only mmio interface.<br />
* MMIO [http://en.wikipedia.org/wiki/Memory-mapped_I/O MMIO = Memory-mapped_I/O] Linux:[http://nouveau.freedesktop.org/wiki/MmioTrace/ MmioTrace Home] [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/trace/mmiotrace.txt mmiotrace doc]<br />
<br />
**'''Note: I have much info/hands-on to add here...'''<br />
<br />
===Debug prints in ROS===<br />
* [http://alter.org.ua/docs/nt_kernel/kdprint/ KdPrint/DbgPrint and OutputDebugString behavior] at Alter's site,<br />
* [http://www.codeproject.com/KB/winsdk/OutputDebugString.aspx?display=Print Mechanism of OutputDebugString - CodeProject] the ready code sample,<br />
They (articles) discuss internals and mechanism of OutputDebugString. Definitely Windows too (as unices) uses system calls to store and receive debug messages data to/from kernel debug messages buffer.<br />
<br />
** [http://www.reactos.org/wiki/Enable_kernel_tracing ROS: Enable kernel tracing]<br />
<br />
<br />
====Unix dmesg Internals Analysis====<br />
''for comparison and for creating something equivalent/analogous in ROS''<br />
Shortly:<br />
*'''Linux''' has special system call "'''syslog'''" (man 2 syslog)<br />
*'''FreeBSD''' uses its special '''sysctl''' interface to kernel along with "'''kern.msgbuf'''" parameter.<br />
<br />
'''D'''o we need special system call like Linux, or even more, the whole<br />
family of them (sysctl('*')) as in BSD?<br />
How to implement simple system call for it, now?<br />
<br />
---<br />
<br />
Detailed info for unices:<br />
<br />
'''Linux case''':<br />
* syslog(2) - read and/or clear kernel message ring buffer; set console_loglevel<br />
int syslog(int type, char *bufp, int len);<br />
* also /proc/kmsg virtual file, which when being read returns buffer contents<br />
<br />
Excerpt from "man proc":<br />
<pre><br />
/proc/kmsg<br />
This file can be used instead of the syslog(2) system<br />
call to read kernel messages. A<br />
process must have superuser privileges to read this<br />
file, and only one process should read<br />
this file. This file should not be read if a syslog<br />
process is running which uses the sys‐<br />
log(2) system call facility to log kernel messages.<br />
<br />
Information in this file is retrieved with the dmesg(1) program.<br />
</pre><br />
<br />
'''dmesg in FreeBSD''':<br />
*Parameter 'kern.msgbuf' given to sysctl(3) returns contents of kernel message buffer.<br />
*There is also 'kern.msgbuf_clear' to clean the buffer.<br />
<br />
<br />
====/*USB====<br />
These could be probably outdated in sense the USB now is in better working state.<br />
* [http://wiki.osdev.org/Main osdev.org wiki] - main page, [http://wiki.osdev.org/USB USB, the same place]<br />
* USB for NT4:<br />
** Alter's site reviews: [http://alter.org.ua/en/docs/win/nt4_usb/ en], [http://alter.org.ua/ru/docs/win/nt4_usb/ ru]<br />
** Woodheads opensource(!), GPL USB driver: [ftp://piekraste.daba.lv/pub/Service_Pack/NT_4/NT4_USB/HS/ files backed up] [http://www.geocities.com/mypublic99/index.html "Woodhead--NT4--USB" original link (dead)]<br />
** [http://nt4ref.zcm.com.au/usb.htm Windows NT 4.0 and USB] Quote: "Conclusion: I wish people would stop making comments like 'USB is not supported under NT4' - If you must comment please make it accurate, example: 'Microsoft have made the commercial decision not to provide NT4 USB support - but some manufacturers provide support for specific USB devices on NT4.'"<br />
<br />
====*/====<br />
<br />
<br />
=== FreeLoader, debug information, getting===<br />
Related with low-memory bug: 1) 4Gb was recognized as 25Mb 2) ROS started with 25Mb silently eat up 100% CPU and infinitely read from boot CD/HDD.<br />
* Debugging the FreeLdr: [http://jira.reactos.org/secure/attachment/16335/freeldr.patch freeldr.patch turning on debug mode] from [http://jira.reactos.org/browse/CORE-5462 CORE-5462] -- patch by ''rafalh''<br />
* [[FreeLoader]]<br />
<br />
Misc...<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=7915#p68991 by gabrielilardi @ 20 Jan 2010, forum of ROS]<br />
* [http://www.reactos.org/forum/viewtopic.php?p=62488#p62488 by hto @13 Jul 2009]<br />
<br />
===SVN how-to links===<br />
* [http://subversion.apache.org/faq.html] found through google [svn through proxy]<br />
* [http://www.mikepot.com/1544.html], same<br />
* SVN book: [http://svn.zen-cart.org.ua/documentation/en/book/svn-book.html Version Control with Subversion 1.2]<br />
** [http://svn.zen-cart.org.ua/documentation/ru/book/ Same SVN guide, russian]</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna.&diff=36268User:Mna.2015-01-02T00:43:05Z<p>Mna.: /* MyBookmarks */</p>
<hr />
<div>My patches to ReactOS// My Bookmarks with useful info// Future place for Manifest-like texts.<br />
<br />
==My Patches/WIP==<br />
''(WIP = Work in Progress)''<br />
* [Done] dmesg/kmesg command in ReactOS native kernel debugger [http://jira.reactos.org/browse/CORE-5452 CORE-5452], described there.<br />
** --<br />
* [Done/not-included] dmesg.exe User-mode utility: done. but not applied (.rbuild system was broken/removed then at the moment + 3 month delay of community considering accepting my kmesg patch).<br />
* [Almost done:forming a patch] (Important thing): MMIO for serial card at kernel early-boot. <del>(MMIO serial cards doesn't work at all in ROS.)</del><br />
** Now it works but I don't know how I will test this on real hardware with [http://jira.reactos.org/browse/CORE-8062 CORE-8062] bug leaving the computer in non-working state after every restart and turn-off.<br />
* [Done] micropatch: print CPUs count and available RAM at ROS start (work related with low-memory related bug)<br />
* (..describe later..: partitions' bug, FAT32-moved-root-node, etc)<br />
* usetup.c - series: [http://jira.reactos.org/browse/CORE-7969 CORE-7969] submitted patch at 08.03.2014: will see how long it will stay not applied. (needed to retest new hanges required by multilanguage support; will do after early-Serial-MMIO)<br />
<br />
==Issues: Reported and not yet==<br />
* [http://jira.reactos.org/browse/CORE-7978 CORE-7978] - ReactOS boot code of MBR can't boot USB-HDD due to error reading sectors with int13h_ah=42h<br />
** Added there link to very good explanation how does GRUB stage1 loader work! Just an amazingly detailed description (and also even with joke in stage2!) [http://thestarman.pcministry.com/asm/mbr/GRUB.htm This] link.<br />
** Workaround: use grub-2 to load freeldr.sys<br />
** freeldr.ini also requires editing the rdisk() parameter addressing the disks:<br />
SystemPath=multi(0)disk(0)rdisk(1)partition(2)\ReactOS<br />
<br />
rdisk(1)partition(2) here means: 2nd disk, 2nd partition. (partitions are 1-counted, rdisks - 0-counted.)<br />
<br />
* [Yet old bug of 2010/11 times until now] (On my machine: AcerAspire5920g) ReactOS loading process stuck on line ...\Drivers\DISK.SYS when Disk operation mode in BIOS is set to AHCI. Changed the mode to IDE "workarounds" the problem: ntoskrnl.exe reaches the last line ...\Drivers\NDIS.SYS -- and is stuck somewhere more later -- eating 100% CPU. (//Debug-log is required)<br />
So the summary: SATA2 is not fully supported by ReactOS, forced to use IDE.<br />
<br />
* [http://jira.reactos.org/browse/CORE-8062 CORE-8062] Nasty bug made me thing my laptop monitor (matrix chip) or videocard goes fried with some code of reactos; Luckily it was just wrong settings somewhere there. Unhealthy bug; leaves bad mood on any tester, it needed to be corrected by any mean.<br />
<br />
==Bookmarks on Topics ==<br />
Interesting topics, links (Started at 2011-04-03)<br />
<br />
Here I will keep links to forum topics, wiki pages or other, that seemed to be interesting:<br />
<br />
====(Generic) Development====<br />
* [irc://irc.freenode.net/reactos #reactos] - For general discussion and user support, most people are here<br />
* [http://jira.reactos.org/issues/?filter=-4 All issues of ReactOS] [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20ORDER%20BY%20createdDate%20DESC bugs only]<br />
* [[Missing ReactOS Functionality]] - major things absent of ROS from User PoV<br />
* [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20ORDER%20BY%20priority%20DESC%2C%20createdDate%20DESC Sorted by importance (''priority'' now in JIRA) bugs of ReactOS], excepto of resolved ones<br />
<br />
* [http://www.reactos.org/wiki/How_PnP_Works_in_ReactOS How PnP Works in ReactOS]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8459 ReactOS, how much money it requires?] - here is only the idea, to be converted to become more correct: "How many man-months?", given man-month is more like a myth, reconsider on per-project basis<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8126 HOWTO Become a Reactos Programmer?] - forum topic, could be converted to more constructive instruction<br />
* [http://dslab.epfl.ch/proj/reveng RevEng: Device Driver Reverse Engineering] from [http://www.reactos.org/forum/viewtopic.php?f=9&t=7990 here]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8206 Command-line-only Win32 from ReactOS?] The topic about full OS without GUI ("headless"?).<br />
** Resembles me idea of [http://hex.pp.ua/nt-native-applications-shell-eng.php Windows/ReactOS Native Shell]) ([http://www.reactos.org/forum/viewtopic.php?f=11&t=9092 Russian]).<br />
<br />
====ReactOS Startup procedure : startup CD ====<br />
* [[Modify the final ISO image]] - good article, have also notes on how (bootcd) final CD-image is composed<br />
* [http://iso.reactos.org/bootcd/ bootcd repository] iso.reactos.org bootcd images<br />
* [http://iso.reactos.org/livecd/ livecd repository]<br />
<br />
====ReactOS Startup procedure and related ====<br />
* [[FreeLoader]], details, <br />
[[User:Mna./FreeLoader,_bootcd_and_bootrecords#FreeLoader_freeldr_Architecture|freeldr Architecture]] and related startup steps: [[User:Mna./FreeLoader,_bootcd_and_bootrecords|bootcd and bootrecords]]<br />
* [http://en.wikipedia.org/wiki/Windows_NT_Startup_Process Windows NT Startup Process/ Sequence]<br />
** [[User:Mna./ReactOS startup process light summary]]<br />
* [[How the system Finds and Loads Drivers]]<br />
<br />
==== ROS build system hands-on ====<br />
* [[Building_Modules#List_available_ninja_targets|available ninja targets]]<br />
* [[Building_Modules#Removing_or_Updating_a_Module|Updating a module code]] -- do this when the ROS module code was changed and build system didn't notice<br />
* Strange thing become clear; Ctrl+D doesn't work in 1st stage setup.<br />
BootOptions=DbgOsLoadOptions = "/NOGUIBOOT /DEBUGPORT=COM:io,0x3f8,115200n8 /DEBUGPORT=SCREEN" See also [[User:Mna./FreeLoader_freeldr_Architecture#Specifing_Boot_Options|Specifing Boot kernel Options]] ((Not confuse it with [[Boot_options#Options|Boot Options]]))<br />
<br />
====Filesystems generic====<br />
* [[File Systems]], a good page<br />
<br />
====Editing ReactOS registry offline====<br />
From [http://www.reactos.org/forum/viewtopic.php?t=3162 here]<br />
{| class="wikitable"<br />
|-<br />
| <br />
Editing ReactOS registry hives outside ReactOS?<br />
--2006-12<br />
<br />
> Is it possible at this moment to edit the registry hives outside the ReactOS environment?<br />
> I wanted to automate a process to load these registry hives onto the local registry, <br />
> add all my changes, unload the hives and create a new ISO.<br />
<br />
Simply change registry sources and build your own binary hives from them.<br />
<br />
by hto <br/><br />
<br />
> I guess "make" is the prefered way, there isn't any other method for creating these hives?<br /><br />
<br />
There is hive maker in tools\mkhive. You can build it with mingw32-make.exe mkhive<br />
<br />
Copy it from output-i386\tools\mkhive\mkhive.exe to (say) Windows\mkhive.exe.<br />
Then run this command:<br />
<br />
mkhive.exe boot\bootdata output-i386\livecd\reactos\system32\config boot\bootdata\livecd.inf boot\bootdata\hiveinst.inf<br />
<br />
Where output-i386\livecd\reactos\system32\config -- is output folder for hives.<br />
This is how ''make livecd'' does it.<br />
And yes, you can add your foo.inf to the end of that command.<br />
|}<br />
<br />
====NTFS====<br />
* post about [http://www.reactos.org/forum/viewtopic.php?f=9&t=8180#p71875 FUSE-lib creation attempts in ROS] in the "[http://www.reactos.org/forum/viewtopic.php?f=9&t=8180 NTFS question]" topic<br />
* (ru) [http://www.reactos.org/forum/viewtopic.php?f=11&t=8606 NTFS-3G applied to ROS], with ''unixed'' 's idea how to integrate into the '''fuse4win''' or '''dokan'''<br />
<br />
====Misc====<br />
* [http://jira.reactos.org/browse/CORE-8059 Possible solution for Intel's HDA] Audio, high-definition audio<br />
* [http://alter.org.ua/soft/win/uni_ata/ UniATA] project of Alter<br />
* [http://alter.org.ua/en/soft/win/vidcontrol/ Display Control for Windows], Alter's site; Now part of [http://alter.org.ua/en/soft/win/uictl/ UI ctl]<br />
<br />
===Serial extension card and MMIO programming===<br />
* [https://android.googlesource.com/kernel/omap/+/glass-omap-xrr02/drivers/tty/serial/8250_early.c android kernel driver tty-serial 8250_early.c] : as serial debug interface, Android can specify not only IO-ports, but also MMIO and MMIO32 addresses. The "shentek" serial card which I own, requires such communication method, it is based on Oxford chip and gives only mmio interface.<br />
* MMIO [http://en.wikipedia.org/wiki/Memory-mapped_I/O MMIO = Memory-mapped_I/O] Linux:[http://nouveau.freedesktop.org/wiki/MmioTrace/ MmioTrace Home] [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/trace/mmiotrace.txt mmiotrace doc]<br />
<br />
**'''Note: I have much info/hands-on to add here...'''<br />
<br />
===Debug prints in ROS===<br />
* [http://alter.org.ua/docs/nt_kernel/kdprint/ KdPrint/DbgPrint and OutputDebugString behavior] at Alter's site,<br />
* [http://www.codeproject.com/KB/winsdk/OutputDebugString.aspx?display=Print Mechanism of OutputDebugString - CodeProject] the ready code sample,<br />
They (articles) discuss internals and mechanism of OutputDebugString. Definitely Windows too (as unices) uses system calls to store and receive debug messages data to/from kernel debug messages buffer.<br />
<br />
** [http://www.reactos.org/wiki/Enable_kernel_tracing ROS: Enable kernel tracing]<br />
<br />
<br />
====Unix dmesg Internals Analysis====<br />
''for comparison and for creating something equivalent/analogous in ROS''<br />
Shortly:<br />
*'''Linux''' has special system call "'''syslog'''" (man 2 syslog)<br />
*'''FreeBSD''' uses its special '''sysctl''' interface to kernel along with "'''kern.msgbuf'''" parameter.<br />
<br />
'''D'''o we need special system call like Linux, or even more, the whole<br />
family of them (sysctl('*')) as in BSD?<br />
How to implement simple system call for it, now?<br />
<br />
---<br />
<br />
Detailed info for unices:<br />
<br />
'''Linux case''':<br />
* syslog(2) - read and/or clear kernel message ring buffer; set console_loglevel<br />
int syslog(int type, char *bufp, int len);<br />
* also /proc/kmsg virtual file, which when being read returns buffer contents<br />
<br />
Excerpt from "man proc":<br />
<pre><br />
/proc/kmsg<br />
This file can be used instead of the syslog(2) system<br />
call to read kernel messages. A<br />
process must have superuser privileges to read this<br />
file, and only one process should read<br />
this file. This file should not be read if a syslog<br />
process is running which uses the sys‐<br />
log(2) system call facility to log kernel messages.<br />
<br />
Information in this file is retrieved with the dmesg(1) program.<br />
</pre><br />
<br />
'''dmesg in FreeBSD''':<br />
*Parameter 'kern.msgbuf' given to sysctl(3) returns contents of kernel message buffer.<br />
*There is also 'kern.msgbuf_clear' to clean the buffer.<br />
<br />
<br />
====/*USB====<br />
These could be probably outdated in sense the USB now is in better working state.<br />
* [http://wiki.osdev.org/Main osdev.org wiki] - main page, [http://wiki.osdev.org/USB USB, the same place]<br />
* USB for NT4:<br />
** Alter's site reviews: [http://alter.org.ua/en/docs/win/nt4_usb/ en], [http://alter.org.ua/ru/docs/win/nt4_usb/ ru]<br />
** Woodheads opensource(!), GPL USB driver: [ftp://piekraste.daba.lv/pub/Service_Pack/NT_4/NT4_USB/HS/ files backed up] [http://www.geocities.com/mypublic99/index.html "Woodhead--NT4--USB" original link (dead)]<br />
** [http://nt4ref.zcm.com.au/usb.htm Windows NT 4.0 and USB] Quote: "Conclusion: I wish people would stop making comments like 'USB is not supported under NT4' - If you must comment please make it accurate, example: 'Microsoft have made the commercial decision not to provide NT4 USB support - but some manufacturers provide support for specific USB devices on NT4.'"<br />
<br />
====*/====<br />
<br />
<br />
=== FreeLoader, debug information, getting===<br />
Related with low-memory bug: 1) 4Gb was recognized as 25Mb 2) ROS started with 25Mb silently eat up 100% CPU and infinitely read from boot CD/HDD.<br />
* Debugging the FreeLdr: [http://jira.reactos.org/secure/attachment/16335/freeldr.patch freeldr.patch turning on debug mode] from [http://jira.reactos.org/browse/CORE-5462 CORE-5462] -- patch by ''rafalh''<br />
* [[FreeLoader]]<br />
<br />
Misc...<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=7915#p68991 by gabrielilardi @ 20 Jan 2010, forum of ROS]<br />
* [http://www.reactos.org/forum/viewtopic.php?p=62488#p62488 by hto @13 Jul 2009]<br />
<br />
===SVN how-to links===<br />
* [http://subversion.apache.org/faq.html] found through google [svn through proxy]<br />
* [http://www.mikepot.com/1544.html], same<br />
* SVN book: [http://svn.zen-cart.org.ua/documentation/en/book/svn-book.html Version Control with Subversion 1.2]<br />
** [http://svn.zen-cart.org.ua/documentation/ru/book/ Same SVN guide, russian]</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna./ReactOS_startup_process_light_summary&diff=34734User:Mna./ReactOS startup process light summary2014-04-11T12:06:34Z<p>Mna.: </p>
<hr />
<div>* Freeldr loads: ROS kernel Ntoskrnl.exe, Hardware Abstraction Layer) hal.dll, language files, and registry's system hive.<br />
* Registry:<br />
''HKEY_LOCAL_MACHINE\System'' contains control sets labeled ControlSet001, ControlSet002, etc., as well as ''CurrentControlSet''. During regular operation, Windows uses CurrentControlSet to read and write information. CurrentControlSet is a reference to one of the control sets stored in the registry. Windows picks the "real" control set being used based on the values set in the HKLM\SYSTEM\Select registry key: ''Default'' will be the boot loader's choice if nothing else overrides this<br />
<br />
* When a control set is chosen, the Current key gets set accordingly.<br />
<br />
* Which services are started and the order each group is started are provided by the following keys:<br />
** HKLM\SYSTEM\CurrentControlSet\Services<br />
** HKLM\SYSTEM\CurrentControlSet\Control\ServiceGroupOrder<br />
<br />
==Driver loading order and types==<br />
For the purposes of booting, a driver may be one of the following:<br />
# A "Boot" driver that is loaded by the boot loader prior to starting the kernel. "Boot" drivers are almost exclusively drivers for hard-disk controllers and file systems (ATA, SCSI, file system filter manager, etc.); in other words, they are the absolute minimum that the kernel will need to get started with loading other drivers, and the rest of the operating system.<br />
# A "System" driver which is loaded and started by the kernel after the boot drivers. "System" drivers cover a wider range of core functionality, including the display driver, CD-ROM support, and the TCP/IP stack.<br />
# An "Automatic" driver which is loaded much later when the GUI already has been started.</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna./ReactOS_startup_process_light_summary&diff=34733User:Mna./ReactOS startup process light summary2014-04-11T12:05:22Z<p>Mna.: </p>
<hr />
<div>* Freeldr loads: ROS kernel Ntoskrnl.exe, Hardware Abstraction Layer) hal.dll, language files, and registry's system hive.<br />
* Registry:<br />
''HKEY_LOCAL_MACHINE\System'' contains control sets labeled ControlSet001, ControlSet002, etc., as well as ''CurrentControlSet''. During regular operation, Windows uses CurrentControlSet to read and write information. CurrentControlSet is a reference to one of the control sets stored in the registry. Windows picks the "real" control set being used based on the values set in the HKLM\SYSTEM\Select registry key: ''Default'' will be the boot loader's choice if nothing else overrides this<br />
<br />
** When a control set is chosen, the Current key gets set accordingly.<br />
** Which services are started and the order each group is started are provided by the following keys:<br />
<br />
*** HKLM\SYSTEM\CurrentControlSet\Services<br />
<br />
*** HKLM\SYSTEM\CurrentControlSet\Control\ServiceGroupOrder<br />
<br />
==Driver loading order and types==<br />
For the purposes of booting, a driver may be one of the following:<br />
# A "Boot" driver that is loaded by the boot loader prior to starting the kernel. "Boot" drivers are almost exclusively drivers for hard-disk controllers and file systems (ATA, SCSI, file system filter manager, etc.); in other words, they are the absolute minimum that the kernel will need to get started with loading other drivers, and the rest of the operating system.<br />
# A "System" driver which is loaded and started by the kernel after the boot drivers. "System" drivers cover a wider range of core functionality, including the display driver, CD-ROM support, and the TCP/IP stack.<br />
# An "Automatic" driver which is loaded much later when the GUI already has been started.</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna.&diff=34731User:Mna.2014-04-10T10:57:18Z<p>Mna.: /* Misc */</p>
<hr />
<div>My patches to ReactOS// My Bookmarks with useful info// Future place for Manifest-like texts.<br />
<br />
==My Patches/WIP==<br />
''(WIP = Work in Progress)''<br />
* [Done] dmesg/kmesg command in ReactOS native kernel debugger [http://jira.reactos.org/browse/CORE-5452 CORE-5452], described there.<br />
** --<br />
* [Done/not-included] dmesg.exe User-mode utility: done. but not applied (.rbuild system was broken/removed then at the moment + 3 month delay of community considering accepting my kmesg patch).<br />
* [Almost done:forming a patch] (Important thing): MMIO for serial card at kernel early-boot. <del>(MMIO serial cards doesn't work at all in ROS.)</del><br />
** Now it works but I don't know how I will test this on real hardware with [http://jira.reactos.org/browse/CORE-8062 CORE-8062] bug leaving the computer in non-working state after every restart and turn-off.<br />
* [Done] micropatch: print CPUs count and available RAM at ROS start (work related with low-memory related bug)<br />
* (..describe later..: partitions' bug, FAT32-moved-root-node, etc)<br />
* usetup.c - series: [http://jira.reactos.org/browse/CORE-7969 CORE-7969] submitted patch at 08.03.2014: will see how long it will stay not applied. (needed to retest new hanges required by multilanguage support; will do after early-Serial-MMIO)<br />
<br />
==Issues: Reported and not yet==<br />
* [http://jira.reactos.org/browse/CORE-7978 CORE-7978] - ReactOS boot code of MBR can't boot USB-HDD due to error reading sectors with int13h_ah=42h<br />
** Added there link to very good explanation how does GRUB stage1 loader work! Just an amazingly detailed description (and also even with joke in stage2!) [http://thestarman.pcministry.com/asm/mbr/GRUB.htm This] link.<br />
** Workaround: use grub-2 to load freeldr.sys<br />
** freeldr.ini also requires editing the rdisk() parameter addressing the disks:<br />
SystemPath=multi(0)disk(0)rdisk(1)partition(2)\ReactOS<br />
<br />
rdisk(1)partition(2) here means: 2nd disk, 2nd partition. (partitions are 1-counted, rdisks - 0-counted.)<br />
<br />
* [Yet old bug of 2010/11 times until now] (On my machine: AcerAspire5920g) ReactOS loading process stuck on line ...\Drivers\DISK.SYS when Disk operation mode in BIOS is set to AHCI. Changed the mode to IDE "workarounds" the problem: ntoskrnl.exe reaches the last line ...\Drivers\NDIS.SYS -- and is stuck somewhere more later -- eating 100% CPU. (//Debug-log is required)<br />
So the summary: SATA2 is not fully supported by ReactOS, forced to use IDE.<br />
<br />
* [http://jira.reactos.org/browse/CORE-8062 CORE-8062] Nasty bug made me thing my laptop monitor (matrix chip) or videocard goes fried with some code of reactos; Luckily it was just wrong settings somewhere there. Unhealthy bug; leaves bad mood on any tester, it needed to be corrected by any mean.<br />
<br />
==MyBookmarks==<br />
Interesting topics, links (Started at 2011-04-03)<br />
<br />
Here I will keep links to forum topics, wiki pages or other, that seemed to be interesting:<br />
<br />
====(Generic) Development====<br />
* [http://jira.reactos.org/issues/?filter=-4 All issues of ReactOS] [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20ORDER%20BY%20createdDate%20DESC bugs only]<br />
* [[Missing ReactOS Functionality]] - major things absent of ROS from User PoV<br />
* [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20ORDER%20BY%20priority%20DESC%2C%20createdDate%20DESC Sorted by importance (''priority'' now in JIRA) bugs of ReactOS], excepto of resolved ones<br />
<br />
* [http://www.reactos.org/wiki/How_PnP_Works_in_ReactOS How PnP Works in ReactOS]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8459 ReactOS, how much money it requires?] - here is only the idea, to be converted to become more correct: "How many man-months?", given man-month is more like a myth, reconsider on per-project basis<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8126 HOWTO Become a Reactos Programmer?] - forum topic, could be converted to more constructive instruction<br />
* [http://dslab.epfl.ch/proj/reveng RevEng: Device Driver Reverse Engineering] from [http://www.reactos.org/forum/viewtopic.php?f=9&t=7990 here]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8206 Command-line-only Win32 from ReactOS?] The topic about full OS without GUI ("headless"?).<br />
** Resembles me idea of [http://hex.pp.ua/nt-native-applications-shell-eng.php Windows/ReactOS Native Shell]) ([http://www.reactos.org/forum/viewtopic.php?f=11&t=9092 Russian]).<br />
* [[Modify the final ISO image]] - good article, have also notes on how (bootcd) final CD-image is composed<br />
* [http://iso.reactos.org/bootcd/ bootcd repository] iso.reactos.org bootcd images<br />
* [http://iso.reactos.org/livecd/ livecd repository]<br />
<br />
* [[FreeLoader]], details, [[User:Mna./FreeLoader,_bootcd_and_bootrecords#FreeLoader_freeldr_Architecture|freeldr Architecture]] and related startup steps: [[User:Mna./FreeLoader,_bootcd_and_bootrecords|bootcd and bootrecords]]<br />
* [http://en.wikipedia.org/wiki/Windows_NT_Startup_Process Windows NT Startup Process/ Sequence]<br />
** [[User:Mna./ReactOS startup process light summary]]<br />
* [[How the system Finds and Loads Drivers]]<br />
* ROS build system hands-on:<br />
** [[Building_Modules#List_available_ninja_targets|available ninja targets]]<br />
** [[Building_Modules#Removing_or_Updating_a_Module|Updating a module code]] -- do this when the ROS module code was changed and build system didn't notice<br />
** Strange thing become clear; Ctrl+D doesn't work in 1st stage setup.<br />
BootOptions=DbgOsLoadOptions = "/NOGUIBOOT /DEBUGPORT=COM:io,0x3f8,115200n8 /DEBUGPORT=SCREEN" See also [[User:Mna./FreeLoader_freeldr_Architecture#Specifing_Boot_Options|Specifing Boot kernel Options]] ((Not confuse it with [[Boot_options#Options|Boot Options]]))<br />
* [irc://irc.freenode.net/reactos #reactos] - For general discussion and user support, most people are here<br />
<br />
====Filesystems generic====<br />
* [[File Systems]], a good page<br />
<br />
====Editing ReactOS registry offline====<br />
From [http://www.reactos.org/forum/viewtopic.php?t=3162 here]<br />
{| class="wikitable"<br />
|-<br />
| <br />
Editing ReactOS registry hives outside ReactOS?<br />
--2006-12<br />
<br />
> Is it possible at this moment to edit the registry hives outside the ReactOS environment?<br />
> I wanted to automate a process to load these registry hives onto the local registry, <br />
> add all my changes, unload the hives and create a new ISO.<br />
<br />
Simply change registry sources and build your own binary hives from them.<br />
<br />
by hto <br/><br />
<br />
> I guess "make" is the prefered way, there isn't any other method for creating these hives?<br /><br />
<br />
There is hive maker in tools\mkhive. You can build it with mingw32-make.exe mkhive<br />
<br />
Copy it from output-i386\tools\mkhive\mkhive.exe to (say) Windows\mkhive.exe.<br />
Then run this command:<br />
<br />
mkhive.exe boot\bootdata output-i386\livecd\reactos\system32\config boot\bootdata\livecd.inf boot\bootdata\hiveinst.inf<br />
<br />
Where output-i386\livecd\reactos\system32\config -- is output folder for hives.<br />
This is how ''make livecd'' does it.<br />
And yes, you can add your foo.inf to the end of that command.<br />
|}<br />
<br />
====NTFS====<br />
* post about [http://www.reactos.org/forum/viewtopic.php?f=9&t=8180#p71875 FUSE-lib creation attempts in ROS] in the "[http://www.reactos.org/forum/viewtopic.php?f=9&t=8180 NTFS question]" topic<br />
* (ru) [http://www.reactos.org/forum/viewtopic.php?f=11&t=8606 NTFS-3G applied to ROS], with ''unixed'' 's idea how to integrate into the '''fuse4win''' or '''dokan'''<br />
<br />
====Misc====<br />
* [http://jira.reactos.org/browse/CORE-8059 Possible solution for Intel's HDA] Audio, high-definition audio<br />
* [http://alter.org.ua/soft/win/uni_ata/ UniATA] project of Alter<br />
* [http://alter.org.ua/en/soft/win/vidcontrol/ Display Control for Windows], Alter's site; Now part of [http://alter.org.ua/en/soft/win/uictl/ UI ctl]<br />
<br />
===Serial extension card and MMIO programming===<br />
* [https://android.googlesource.com/kernel/omap/+/glass-omap-xrr02/drivers/tty/serial/8250_early.c android kernel driver tty-serial 8250_early.c] : as serial debug interface, Android can specify not only IO-ports, but also MMIO and MMIO32 addresses. The "shentek" serial card which I own, requires such communication method, it is based on Oxford chip and gives only mmio interface.<br />
* MMIO [http://en.wikipedia.org/wiki/Memory-mapped_I/O MMIO = Memory-mapped_I/O] Linux:[http://nouveau.freedesktop.org/wiki/MmioTrace/ MmioTrace Home] [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/trace/mmiotrace.txt mmiotrace doc]<br />
<br />
**'''Note: I have much info/hands-on to add here...'''<br />
<br />
===Debug prints in ROS===<br />
* [http://alter.org.ua/docs/nt_kernel/kdprint/ KdPrint/DbgPrint and OutputDebugString behavior] at Alter's site,<br />
* [http://www.codeproject.com/KB/winsdk/OutputDebugString.aspx?display=Print Mechanism of OutputDebugString - CodeProject] the ready code sample,<br />
They (articles) discuss internals and mechanism of OutputDebugString. Definitely Windows too (as unices) uses system calls to store and receive debug messages data to/from kernel debug messages buffer.<br />
<br />
** [http://www.reactos.org/wiki/Enable_kernel_tracing ROS: Enable kernel tracing]<br />
<br />
<br />
====Unix dmesg Internals Analysis====<br />
''for comparison and for creating something equivalent/analogous in ROS''<br />
Shortly:<br />
*'''Linux''' has special system call "'''syslog'''" (man 2 syslog)<br />
*'''FreeBSD''' uses its special '''sysctl''' interface to kernel along with "'''kern.msgbuf'''" parameter.<br />
<br />
'''D'''o we need special system call like Linux, or even more, the whole<br />
family of them (sysctl('*')) as in BSD?<br />
How to implement simple system call for it, now?<br />
<br />
---<br />
<br />
Detailed info for unices:<br />
<br />
'''Linux case''':<br />
* syslog(2) - read and/or clear kernel message ring buffer; set console_loglevel<br />
int syslog(int type, char *bufp, int len);<br />
* also /proc/kmsg virtual file, which when being read returns buffer contents<br />
<br />
Excerpt from "man proc":<br />
<pre><br />
/proc/kmsg<br />
This file can be used instead of the syslog(2) system<br />
call to read kernel messages. A<br />
process must have superuser privileges to read this<br />
file, and only one process should read<br />
this file. This file should not be read if a syslog<br />
process is running which uses the sys‐<br />
log(2) system call facility to log kernel messages.<br />
<br />
Information in this file is retrieved with the dmesg(1) program.<br />
</pre><br />
<br />
'''dmesg in FreeBSD''':<br />
*Parameter 'kern.msgbuf' given to sysctl(3) returns contents of kernel message buffer.<br />
*There is also 'kern.msgbuf_clear' to clean the buffer.<br />
<br />
<br />
====/*USB====<br />
These could be probably outdated in sense the USB now is in better working state.<br />
* [http://wiki.osdev.org/Main osdev.org wiki] - main page, [http://wiki.osdev.org/USB USB, the same place]<br />
* USB for NT4:<br />
** Alter's site reviews: [http://alter.org.ua/en/docs/win/nt4_usb/ en], [http://alter.org.ua/ru/docs/win/nt4_usb/ ru]<br />
** Woodheads opensource(!), GPL USB driver: [ftp://piekraste.daba.lv/pub/Service_Pack/NT_4/NT4_USB/HS/ files backed up] [http://www.geocities.com/mypublic99/index.html "Woodhead--NT4--USB" original link (dead)]<br />
** [http://nt4ref.zcm.com.au/usb.htm Windows NT 4.0 and USB] Quote: "Conclusion: I wish people would stop making comments like 'USB is not supported under NT4' - If you must comment please make it accurate, example: 'Microsoft have made the commercial decision not to provide NT4 USB support - but some manufacturers provide support for specific USB devices on NT4.'"<br />
<br />
====*/====<br />
<br />
<br />
=== FreeLoader, debug information, getting===<br />
Related with low-memory bug: 1) 4Gb was recognized as 25Mb 2) ROS started with 25Mb silently eat up 100% CPU and infinitely read from boot CD/HDD.<br />
* Debugging the FreeLdr: [http://jira.reactos.org/secure/attachment/16335/freeldr.patch freeldr.patch turning on debug mode] from [http://jira.reactos.org/browse/CORE-5462 CORE-5462] -- patch by ''rafalh''<br />
* [[FreeLoader]]<br />
<br />
Misc...<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=7915#p68991 by gabrielilardi @ 20 Jan 2010, forum of ROS]<br />
* [http://www.reactos.org/forum/viewtopic.php?p=62488#p62488 by hto @13 Jul 2009]<br />
<br />
===SVN how-to links===<br />
* [http://subversion.apache.org/faq.html] found through google [svn through proxy]<br />
* [http://www.mikepot.com/1544.html], same<br />
* SVN book: [http://svn.zen-cart.org.ua/documentation/en/book/svn-book.html Version Control with Subversion 1.2]<br />
** [http://svn.zen-cart.org.ua/documentation/ru/book/ Same SVN guide, russian]</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna.&diff=34730User:Mna.2014-04-10T10:54:41Z<p>Mna.: /* My Patches/WIP */</p>
<hr />
<div>My patches to ReactOS// My Bookmarks with useful info// Future place for Manifest-like texts.<br />
<br />
==My Patches/WIP==<br />
''(WIP = Work in Progress)''<br />
* [Done] dmesg/kmesg command in ReactOS native kernel debugger [http://jira.reactos.org/browse/CORE-5452 CORE-5452], described there.<br />
** --<br />
* [Done/not-included] dmesg.exe User-mode utility: done. but not applied (.rbuild system was broken/removed then at the moment + 3 month delay of community considering accepting my kmesg patch).<br />
* [Almost done:forming a patch] (Important thing): MMIO for serial card at kernel early-boot. <del>(MMIO serial cards doesn't work at all in ROS.)</del><br />
** Now it works but I don't know how I will test this on real hardware with [http://jira.reactos.org/browse/CORE-8062 CORE-8062] bug leaving the computer in non-working state after every restart and turn-off.<br />
* [Done] micropatch: print CPUs count and available RAM at ROS start (work related with low-memory related bug)<br />
* (..describe later..: partitions' bug, FAT32-moved-root-node, etc)<br />
* usetup.c - series: [http://jira.reactos.org/browse/CORE-7969 CORE-7969] submitted patch at 08.03.2014: will see how long it will stay not applied. (needed to retest new hanges required by multilanguage support; will do after early-Serial-MMIO)<br />
<br />
==Issues: Reported and not yet==<br />
* [http://jira.reactos.org/browse/CORE-7978 CORE-7978] - ReactOS boot code of MBR can't boot USB-HDD due to error reading sectors with int13h_ah=42h<br />
** Added there link to very good explanation how does GRUB stage1 loader work! Just an amazingly detailed description (and also even with joke in stage2!) [http://thestarman.pcministry.com/asm/mbr/GRUB.htm This] link.<br />
** Workaround: use grub-2 to load freeldr.sys<br />
** freeldr.ini also requires editing the rdisk() parameter addressing the disks:<br />
SystemPath=multi(0)disk(0)rdisk(1)partition(2)\ReactOS<br />
<br />
rdisk(1)partition(2) here means: 2nd disk, 2nd partition. (partitions are 1-counted, rdisks - 0-counted.)<br />
<br />
* [Yet old bug of 2010/11 times until now] (On my machine: AcerAspire5920g) ReactOS loading process stuck on line ...\Drivers\DISK.SYS when Disk operation mode in BIOS is set to AHCI. Changed the mode to IDE "workarounds" the problem: ntoskrnl.exe reaches the last line ...\Drivers\NDIS.SYS -- and is stuck somewhere more later -- eating 100% CPU. (//Debug-log is required)<br />
So the summary: SATA2 is not fully supported by ReactOS, forced to use IDE.<br />
<br />
* [http://jira.reactos.org/browse/CORE-8062 CORE-8062] Nasty bug made me thing my laptop monitor (matrix chip) or videocard goes fried with some code of reactos; Luckily it was just wrong settings somewhere there. Unhealthy bug; leaves bad mood on any tester, it needed to be corrected by any mean.<br />
<br />
==MyBookmarks==<br />
Interesting topics, links (Started at 2011-04-03)<br />
<br />
Here I will keep links to forum topics, wiki pages or other, that seemed to be interesting:<br />
<br />
====(Generic) Development====<br />
* [http://jira.reactos.org/issues/?filter=-4 All issues of ReactOS] [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20ORDER%20BY%20createdDate%20DESC bugs only]<br />
* [[Missing ReactOS Functionality]] - major things absent of ROS from User PoV<br />
* [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20ORDER%20BY%20priority%20DESC%2C%20createdDate%20DESC Sorted by importance (''priority'' now in JIRA) bugs of ReactOS], excepto of resolved ones<br />
<br />
* [http://www.reactos.org/wiki/How_PnP_Works_in_ReactOS How PnP Works in ReactOS]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8459 ReactOS, how much money it requires?] - here is only the idea, to be converted to become more correct: "How many man-months?", given man-month is more like a myth, reconsider on per-project basis<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8126 HOWTO Become a Reactos Programmer?] - forum topic, could be converted to more constructive instruction<br />
* [http://dslab.epfl.ch/proj/reveng RevEng: Device Driver Reverse Engineering] from [http://www.reactos.org/forum/viewtopic.php?f=9&t=7990 here]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8206 Command-line-only Win32 from ReactOS?] The topic about full OS without GUI ("headless"?).<br />
** Resembles me idea of [http://hex.pp.ua/nt-native-applications-shell-eng.php Windows/ReactOS Native Shell]) ([http://www.reactos.org/forum/viewtopic.php?f=11&t=9092 Russian]).<br />
* [[Modify the final ISO image]] - good article, have also notes on how (bootcd) final CD-image is composed<br />
* [http://iso.reactos.org/bootcd/ bootcd repository] iso.reactos.org bootcd images<br />
* [http://iso.reactos.org/livecd/ livecd repository]<br />
<br />
* [[FreeLoader]], details, [[User:Mna./FreeLoader,_bootcd_and_bootrecords#FreeLoader_freeldr_Architecture|freeldr Architecture]] and related startup steps: [[User:Mna./FreeLoader,_bootcd_and_bootrecords|bootcd and bootrecords]]<br />
* [http://en.wikipedia.org/wiki/Windows_NT_Startup_Process Windows NT Startup Process/ Sequence]<br />
** [[User:Mna./ReactOS startup process light summary]]<br />
* [[How the system Finds and Loads Drivers]]<br />
* ROS build system hands-on:<br />
** [[Building_Modules#List_available_ninja_targets|available ninja targets]]<br />
** [[Building_Modules#Removing_or_Updating_a_Module|Updating a module code]] -- do this when the ROS module code was changed and build system didn't notice<br />
** Strange thing become clear; Ctrl+D doesn't work in 1st stage setup.<br />
BootOptions=DbgOsLoadOptions = "/NOGUIBOOT /DEBUGPORT=COM:io,0x3f8,115200n8 /DEBUGPORT=SCREEN" See also [[User:Mna./FreeLoader_freeldr_Architecture#Specifing_Boot_Options|Specifing Boot kernel Options]] ((Not confuse it with [[Boot_options#Options|Boot Options]]))<br />
* [irc://irc.freenode.net/reactos #reactos] - For general discussion and user support, most people are here<br />
<br />
====Filesystems generic====<br />
* [[File Systems]], a good page<br />
<br />
====Editing ReactOS registry offline====<br />
From [http://www.reactos.org/forum/viewtopic.php?t=3162 here]<br />
{| class="wikitable"<br />
|-<br />
| <br />
Editing ReactOS registry hives outside ReactOS?<br />
--2006-12<br />
<br />
> Is it possible at this moment to edit the registry hives outside the ReactOS environment?<br />
> I wanted to automate a process to load these registry hives onto the local registry, <br />
> add all my changes, unload the hives and create a new ISO.<br />
<br />
Simply change registry sources and build your own binary hives from them.<br />
<br />
by hto <br/><br />
<br />
> I guess "make" is the prefered way, there isn't any other method for creating these hives?<br /><br />
<br />
There is hive maker in tools\mkhive. You can build it with mingw32-make.exe mkhive<br />
<br />
Copy it from output-i386\tools\mkhive\mkhive.exe to (say) Windows\mkhive.exe.<br />
Then run this command:<br />
<br />
mkhive.exe boot\bootdata output-i386\livecd\reactos\system32\config boot\bootdata\livecd.inf boot\bootdata\hiveinst.inf<br />
<br />
Where output-i386\livecd\reactos\system32\config -- is output folder for hives.<br />
This is how ''make livecd'' does it.<br />
And yes, you can add your foo.inf to the end of that command.<br />
|}<br />
<br />
====NTFS====<br />
* post about [http://www.reactos.org/forum/viewtopic.php?f=9&t=8180#p71875 FUSE-lib creation attempts in ROS] in the "[http://www.reactos.org/forum/viewtopic.php?f=9&t=8180 NTFS question]" topic<br />
* (ru) [http://www.reactos.org/forum/viewtopic.php?f=11&t=8606 NTFS-3G applied to ROS], with ''unixed'' 's idea how to integrate into the '''fuse4win''' or '''dokan'''<br />
<br />
====Misc====<br />
* [http://alter.org.ua/soft/win/uni_ata/ UniATA] project link, Current version is 0.40b2, Updated @2011.03.24. ROS wasn't sinced with it since version-'?.?'...<br />
* [http://alter.org.ua/en/soft/win/vidcontrol/ Display Control for Windows], Alter's site; Now part of [http://alter.org.ua/en/soft/win/uictl/ UI ctl]<br />
<br />
===Serial extension card and MMIO programming===<br />
* [https://android.googlesource.com/kernel/omap/+/glass-omap-xrr02/drivers/tty/serial/8250_early.c android kernel driver tty-serial 8250_early.c] : as serial debug interface, Android can specify not only IO-ports, but also MMIO and MMIO32 addresses. The "shentek" serial card which I own, requires such communication method, it is based on Oxford chip and gives only mmio interface.<br />
* MMIO [http://en.wikipedia.org/wiki/Memory-mapped_I/O MMIO = Memory-mapped_I/O] Linux:[http://nouveau.freedesktop.org/wiki/MmioTrace/ MmioTrace Home] [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/trace/mmiotrace.txt mmiotrace doc]<br />
<br />
**'''Note: I have much info/hands-on to add here...'''<br />
<br />
===Debug prints in ROS===<br />
* [http://alter.org.ua/docs/nt_kernel/kdprint/ KdPrint/DbgPrint and OutputDebugString behavior] at Alter's site,<br />
* [http://www.codeproject.com/KB/winsdk/OutputDebugString.aspx?display=Print Mechanism of OutputDebugString - CodeProject] the ready code sample,<br />
They (articles) discuss internals and mechanism of OutputDebugString. Definitely Windows too (as unices) uses system calls to store and receive debug messages data to/from kernel debug messages buffer.<br />
<br />
** [http://www.reactos.org/wiki/Enable_kernel_tracing ROS: Enable kernel tracing]<br />
<br />
<br />
====Unix dmesg Internals Analysis====<br />
''for comparison and for creating something equivalent/analogous in ROS''<br />
Shortly:<br />
*'''Linux''' has special system call "'''syslog'''" (man 2 syslog)<br />
*'''FreeBSD''' uses its special '''sysctl''' interface to kernel along with "'''kern.msgbuf'''" parameter.<br />
<br />
'''D'''o we need special system call like Linux, or even more, the whole<br />
family of them (sysctl('*')) as in BSD?<br />
How to implement simple system call for it, now?<br />
<br />
---<br />
<br />
Detailed info for unices:<br />
<br />
'''Linux case''':<br />
* syslog(2) - read and/or clear kernel message ring buffer; set console_loglevel<br />
int syslog(int type, char *bufp, int len);<br />
* also /proc/kmsg virtual file, which when being read returns buffer contents<br />
<br />
Excerpt from "man proc":<br />
<pre><br />
/proc/kmsg<br />
This file can be used instead of the syslog(2) system<br />
call to read kernel messages. A<br />
process must have superuser privileges to read this<br />
file, and only one process should read<br />
this file. This file should not be read if a syslog<br />
process is running which uses the sys‐<br />
log(2) system call facility to log kernel messages.<br />
<br />
Information in this file is retrieved with the dmesg(1) program.<br />
</pre><br />
<br />
'''dmesg in FreeBSD''':<br />
*Parameter 'kern.msgbuf' given to sysctl(3) returns contents of kernel message buffer.<br />
*There is also 'kern.msgbuf_clear' to clean the buffer.<br />
<br />
<br />
====/*USB====<br />
These could be probably outdated in sense the USB now is in better working state.<br />
* [http://wiki.osdev.org/Main osdev.org wiki] - main page, [http://wiki.osdev.org/USB USB, the same place]<br />
* USB for NT4:<br />
** Alter's site reviews: [http://alter.org.ua/en/docs/win/nt4_usb/ en], [http://alter.org.ua/ru/docs/win/nt4_usb/ ru]<br />
** Woodheads opensource(!), GPL USB driver: [ftp://piekraste.daba.lv/pub/Service_Pack/NT_4/NT4_USB/HS/ files backed up] [http://www.geocities.com/mypublic99/index.html "Woodhead--NT4--USB" original link (dead)]<br />
** [http://nt4ref.zcm.com.au/usb.htm Windows NT 4.0 and USB] Quote: "Conclusion: I wish people would stop making comments like 'USB is not supported under NT4' - If you must comment please make it accurate, example: 'Microsoft have made the commercial decision not to provide NT4 USB support - but some manufacturers provide support for specific USB devices on NT4.'"<br />
<br />
====*/====<br />
<br />
<br />
=== FreeLoader, debug information, getting===<br />
Related with low-memory bug: 1) 4Gb was recognized as 25Mb 2) ROS started with 25Mb silently eat up 100% CPU and infinitely read from boot CD/HDD.<br />
* Debugging the FreeLdr: [http://jira.reactos.org/secure/attachment/16335/freeldr.patch freeldr.patch turning on debug mode] from [http://jira.reactos.org/browse/CORE-5462 CORE-5462] -- patch by ''rafalh''<br />
* [[FreeLoader]]<br />
<br />
Misc...<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=7915#p68991 by gabrielilardi @ 20 Jan 2010, forum of ROS]<br />
* [http://www.reactos.org/forum/viewtopic.php?p=62488#p62488 by hto @13 Jul 2009]<br />
<br />
===SVN how-to links===<br />
* [http://subversion.apache.org/faq.html] found through google [svn through proxy]<br />
* [http://www.mikepot.com/1544.html], same<br />
* SVN book: [http://svn.zen-cart.org.ua/documentation/en/book/svn-book.html Version Control with Subversion 1.2]<br />
** [http://svn.zen-cart.org.ua/documentation/ru/book/ Same SVN guide, russian]</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna.&diff=34729User:Mna.2014-04-10T10:47:40Z<p>Mna.: /* Issues: Reported and not yet */</p>
<hr />
<div>My patches to ReactOS// My Bookmarks with useful info// Future place for Manifest-like texts.<br />
<br />
==My Patches/WIP==<br />
''(WIP = Work in Progress)''<br />
* [Done] dmesg/kmesg command in ReactOS native kernel debugger [https://jira.reactos.org/browse/CORE-5452 CORE-5452], described there.<br />
** --<br />
* [Done/not-included] dmesg.exe User-mode utility: done. but not applied (.rbuild system was broken/removed then at the moment + 3 month delay of community considering accepting my kmesg patch).<br />
* WIP (Important thing): MMIO for serial card at kernel early-boot. -- MMIO serial cards doesn't work at all in ROS.<br />
* [Done] micropatch: print CPUs count and available RAM at ROS start (work related with low-memory related bug)<br />
* (..describe later..: partitions' bug, FAT32-moved-root-node, etc)<br />
* usetup.c - series: [http://jira.reactos.org/browse/CORE-7969 CORE-7969] submitted patch at 08.03.2014: will see how long it will stay not applied. (+1week later)<br />
<br />
==Issues: Reported and not yet==<br />
* [http://jira.reactos.org/browse/CORE-7978 CORE-7978] - ReactOS boot code of MBR can't boot USB-HDD due to error reading sectors with int13h_ah=42h<br />
** Added there link to very good explanation how does GRUB stage1 loader work! Just an amazingly detailed description (and also even with joke in stage2!) [http://thestarman.pcministry.com/asm/mbr/GRUB.htm This] link.<br />
** Workaround: use grub-2 to load freeldr.sys<br />
** freeldr.ini also requires editing the rdisk() parameter addressing the disks:<br />
SystemPath=multi(0)disk(0)rdisk(1)partition(2)\ReactOS<br />
<br />
rdisk(1)partition(2) here means: 2nd disk, 2nd partition. (partitions are 1-counted, rdisks - 0-counted.)<br />
<br />
* [Yet old bug of 2010/11 times until now] (On my machine: AcerAspire5920g) ReactOS loading process stuck on line ...\Drivers\DISK.SYS when Disk operation mode in BIOS is set to AHCI. Changed the mode to IDE "workarounds" the problem: ntoskrnl.exe reaches the last line ...\Drivers\NDIS.SYS -- and is stuck somewhere more later -- eating 100% CPU. (//Debug-log is required)<br />
So the summary: SATA2 is not fully supported by ReactOS, forced to use IDE.<br />
<br />
* [http://jira.reactos.org/browse/CORE-8062 CORE-8062] Nasty bug made me thing my laptop monitor (matrix chip) or videocard goes fried with some code of reactos; Luckily it was just wrong settings somewhere there. Unhealthy bug; leaves bad mood on any tester, it needed to be corrected by any mean.<br />
<br />
==MyBookmarks==<br />
Interesting topics, links (Started at 2011-04-03)<br />
<br />
Here I will keep links to forum topics, wiki pages or other, that seemed to be interesting:<br />
<br />
====(Generic) Development====<br />
* [http://jira.reactos.org/issues/?filter=-4 All issues of ReactOS] [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20ORDER%20BY%20createdDate%20DESC bugs only]<br />
* [[Missing ReactOS Functionality]] - major things absent of ROS from User PoV<br />
* [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20ORDER%20BY%20priority%20DESC%2C%20createdDate%20DESC Sorted by importance (''priority'' now in JIRA) bugs of ReactOS], excepto of resolved ones<br />
<br />
* [http://www.reactos.org/wiki/How_PnP_Works_in_ReactOS How PnP Works in ReactOS]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8459 ReactOS, how much money it requires?] - here is only the idea, to be converted to become more correct: "How many man-months?", given man-month is more like a myth, reconsider on per-project basis<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8126 HOWTO Become a Reactos Programmer?] - forum topic, could be converted to more constructive instruction<br />
* [http://dslab.epfl.ch/proj/reveng RevEng: Device Driver Reverse Engineering] from [http://www.reactos.org/forum/viewtopic.php?f=9&t=7990 here]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8206 Command-line-only Win32 from ReactOS?] The topic about full OS without GUI ("headless"?).<br />
** Resembles me idea of [http://hex.pp.ua/nt-native-applications-shell-eng.php Windows/ReactOS Native Shell]) ([http://www.reactos.org/forum/viewtopic.php?f=11&t=9092 Russian]).<br />
* [[Modify the final ISO image]] - good article, have also notes on how (bootcd) final CD-image is composed<br />
* [http://iso.reactos.org/bootcd/ bootcd repository] iso.reactos.org bootcd images<br />
* [http://iso.reactos.org/livecd/ livecd repository]<br />
<br />
* [[FreeLoader]], details, [[User:Mna./FreeLoader,_bootcd_and_bootrecords#FreeLoader_freeldr_Architecture|freeldr Architecture]] and related startup steps: [[User:Mna./FreeLoader,_bootcd_and_bootrecords|bootcd and bootrecords]]<br />
* [http://en.wikipedia.org/wiki/Windows_NT_Startup_Process Windows NT Startup Process/ Sequence]<br />
** [[User:Mna./ReactOS startup process light summary]]<br />
* [[How the system Finds and Loads Drivers]]<br />
* ROS build system hands-on:<br />
** [[Building_Modules#List_available_ninja_targets|available ninja targets]]<br />
** [[Building_Modules#Removing_or_Updating_a_Module|Updating a module code]] -- do this when the ROS module code was changed and build system didn't notice<br />
** Strange thing become clear; Ctrl+D doesn't work in 1st stage setup.<br />
BootOptions=DbgOsLoadOptions = "/NOGUIBOOT /DEBUGPORT=COM:io,0x3f8,115200n8 /DEBUGPORT=SCREEN" See also [[User:Mna./FreeLoader_freeldr_Architecture#Specifing_Boot_Options|Specifing Boot kernel Options]] ((Not confuse it with [[Boot_options#Options|Boot Options]]))<br />
* [irc://irc.freenode.net/reactos #reactos] - For general discussion and user support, most people are here<br />
<br />
====Filesystems generic====<br />
* [[File Systems]], a good page<br />
<br />
====Editing ReactOS registry offline====<br />
From [http://www.reactos.org/forum/viewtopic.php?t=3162 here]<br />
{| class="wikitable"<br />
|-<br />
| <br />
Editing ReactOS registry hives outside ReactOS?<br />
--2006-12<br />
<br />
> Is it possible at this moment to edit the registry hives outside the ReactOS environment?<br />
> I wanted to automate a process to load these registry hives onto the local registry, <br />
> add all my changes, unload the hives and create a new ISO.<br />
<br />
Simply change registry sources and build your own binary hives from them.<br />
<br />
by hto <br/><br />
<br />
> I guess "make" is the prefered way, there isn't any other method for creating these hives?<br /><br />
<br />
There is hive maker in tools\mkhive. You can build it with mingw32-make.exe mkhive<br />
<br />
Copy it from output-i386\tools\mkhive\mkhive.exe to (say) Windows\mkhive.exe.<br />
Then run this command:<br />
<br />
mkhive.exe boot\bootdata output-i386\livecd\reactos\system32\config boot\bootdata\livecd.inf boot\bootdata\hiveinst.inf<br />
<br />
Where output-i386\livecd\reactos\system32\config -- is output folder for hives.<br />
This is how ''make livecd'' does it.<br />
And yes, you can add your foo.inf to the end of that command.<br />
|}<br />
<br />
====NTFS====<br />
* post about [http://www.reactos.org/forum/viewtopic.php?f=9&t=8180#p71875 FUSE-lib creation attempts in ROS] in the "[http://www.reactos.org/forum/viewtopic.php?f=9&t=8180 NTFS question]" topic<br />
* (ru) [http://www.reactos.org/forum/viewtopic.php?f=11&t=8606 NTFS-3G applied to ROS], with ''unixed'' 's idea how to integrate into the '''fuse4win''' or '''dokan'''<br />
<br />
====Misc====<br />
* [http://alter.org.ua/soft/win/uni_ata/ UniATA] project link, Current version is 0.40b2, Updated @2011.03.24. ROS wasn't sinced with it since version-'?.?'...<br />
* [http://alter.org.ua/en/soft/win/vidcontrol/ Display Control for Windows], Alter's site; Now part of [http://alter.org.ua/en/soft/win/uictl/ UI ctl]<br />
<br />
===Serial extension card and MMIO programming===<br />
* [https://android.googlesource.com/kernel/omap/+/glass-omap-xrr02/drivers/tty/serial/8250_early.c android kernel driver tty-serial 8250_early.c] : as serial debug interface, Android can specify not only IO-ports, but also MMIO and MMIO32 addresses. The "shentek" serial card which I own, requires such communication method, it is based on Oxford chip and gives only mmio interface.<br />
* MMIO [http://en.wikipedia.org/wiki/Memory-mapped_I/O MMIO = Memory-mapped_I/O] Linux:[http://nouveau.freedesktop.org/wiki/MmioTrace/ MmioTrace Home] [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/trace/mmiotrace.txt mmiotrace doc]<br />
<br />
**'''Note: I have much info/hands-on to add here...'''<br />
<br />
===Debug prints in ROS===<br />
* [http://alter.org.ua/docs/nt_kernel/kdprint/ KdPrint/DbgPrint and OutputDebugString behavior] at Alter's site,<br />
* [http://www.codeproject.com/KB/winsdk/OutputDebugString.aspx?display=Print Mechanism of OutputDebugString - CodeProject] the ready code sample,<br />
They (articles) discuss internals and mechanism of OutputDebugString. Definitely Windows too (as unices) uses system calls to store and receive debug messages data to/from kernel debug messages buffer.<br />
<br />
** [http://www.reactos.org/wiki/Enable_kernel_tracing ROS: Enable kernel tracing]<br />
<br />
<br />
====Unix dmesg Internals Analysis====<br />
''for comparison and for creating something equivalent/analogous in ROS''<br />
Shortly:<br />
*'''Linux''' has special system call "'''syslog'''" (man 2 syslog)<br />
*'''FreeBSD''' uses its special '''sysctl''' interface to kernel along with "'''kern.msgbuf'''" parameter.<br />
<br />
'''D'''o we need special system call like Linux, or even more, the whole<br />
family of them (sysctl('*')) as in BSD?<br />
How to implement simple system call for it, now?<br />
<br />
---<br />
<br />
Detailed info for unices:<br />
<br />
'''Linux case''':<br />
* syslog(2) - read and/or clear kernel message ring buffer; set console_loglevel<br />
int syslog(int type, char *bufp, int len);<br />
* also /proc/kmsg virtual file, which when being read returns buffer contents<br />
<br />
Excerpt from "man proc":<br />
<pre><br />
/proc/kmsg<br />
This file can be used instead of the syslog(2) system<br />
call to read kernel messages. A<br />
process must have superuser privileges to read this<br />
file, and only one process should read<br />
this file. This file should not be read if a syslog<br />
process is running which uses the sys‐<br />
log(2) system call facility to log kernel messages.<br />
<br />
Information in this file is retrieved with the dmesg(1) program.<br />
</pre><br />
<br />
'''dmesg in FreeBSD''':<br />
*Parameter 'kern.msgbuf' given to sysctl(3) returns contents of kernel message buffer.<br />
*There is also 'kern.msgbuf_clear' to clean the buffer.<br />
<br />
<br />
====/*USB====<br />
These could be probably outdated in sense the USB now is in better working state.<br />
* [http://wiki.osdev.org/Main osdev.org wiki] - main page, [http://wiki.osdev.org/USB USB, the same place]<br />
* USB for NT4:<br />
** Alter's site reviews: [http://alter.org.ua/en/docs/win/nt4_usb/ en], [http://alter.org.ua/ru/docs/win/nt4_usb/ ru]<br />
** Woodheads opensource(!), GPL USB driver: [ftp://piekraste.daba.lv/pub/Service_Pack/NT_4/NT4_USB/HS/ files backed up] [http://www.geocities.com/mypublic99/index.html "Woodhead--NT4--USB" original link (dead)]<br />
** [http://nt4ref.zcm.com.au/usb.htm Windows NT 4.0 and USB] Quote: "Conclusion: I wish people would stop making comments like 'USB is not supported under NT4' - If you must comment please make it accurate, example: 'Microsoft have made the commercial decision not to provide NT4 USB support - but some manufacturers provide support for specific USB devices on NT4.'"<br />
<br />
====*/====<br />
<br />
<br />
=== FreeLoader, debug information, getting===<br />
Related with low-memory bug: 1) 4Gb was recognized as 25Mb 2) ROS started with 25Mb silently eat up 100% CPU and infinitely read from boot CD/HDD.<br />
* Debugging the FreeLdr: [http://jira.reactos.org/secure/attachment/16335/freeldr.patch freeldr.patch turning on debug mode] from [http://jira.reactos.org/browse/CORE-5462 CORE-5462] -- patch by ''rafalh''<br />
* [[FreeLoader]]<br />
<br />
Misc...<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=7915#p68991 by gabrielilardi @ 20 Jan 2010, forum of ROS]<br />
* [http://www.reactos.org/forum/viewtopic.php?p=62488#p62488 by hto @13 Jul 2009]<br />
<br />
===SVN how-to links===<br />
* [http://subversion.apache.org/faq.html] found through google [svn through proxy]<br />
* [http://www.mikepot.com/1544.html], same<br />
* SVN book: [http://svn.zen-cart.org.ua/documentation/en/book/svn-book.html Version Control with Subversion 1.2]<br />
** [http://svn.zen-cart.org.ua/documentation/ru/book/ Same SVN guide, russian]</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna.&diff=34728User:Mna.2014-04-10T10:44:55Z<p>Mna.: /* Issues: Reported and not yet */</p>
<hr />
<div>My patches to ReactOS// My Bookmarks with useful info// Future place for Manifest-like texts.<br />
<br />
==My Patches/WIP==<br />
''(WIP = Work in Progress)''<br />
* [Done] dmesg/kmesg command in ReactOS native kernel debugger [https://jira.reactos.org/browse/CORE-5452 CORE-5452], described there.<br />
** --<br />
* [Done/not-included] dmesg.exe User-mode utility: done. but not applied (.rbuild system was broken/removed then at the moment + 3 month delay of community considering accepting my kmesg patch).<br />
* WIP (Important thing): MMIO for serial card at kernel early-boot. -- MMIO serial cards doesn't work at all in ROS.<br />
* [Done] micropatch: print CPUs count and available RAM at ROS start (work related with low-memory related bug)<br />
* (..describe later..: partitions' bug, FAT32-moved-root-node, etc)<br />
* usetup.c - series: [http://jira.reactos.org/browse/CORE-7969 CORE-7969] submitted patch at 08.03.2014: will see how long it will stay not applied. (+1week later)<br />
<br />
==Issues: Reported and not yet==<br />
* [http://jira.reactos.org/browse/CORE-7978 CORE-7978] - ReactOS boot code of MBR can't boot USB-HDD due to error reading sectors with int13h_ah=42h<br />
** Added there link to very good explanation how does GRUB stage1 loader work! Just an amazingly detailed description (and also even with joke in stage2!) [http://thestarman.pcministry.com/asm/mbr/GRUB.htm This] link.<br />
** Workaround: use grub-2 to load freeldr.sys<br />
** freeldr.ini also requires editing the rdisk() parameter addressing the disks:<br />
SystemPath=multi(0)disk(0)rdisk(1)partition(2)\ReactOS<br />
<br />
rdisk(1)partition(2) here means: 2nd disk, 2nd partition. (partitions are 1-counted, rdisks - 0-counted.)<br />
<br />
* [Yet old bug of 2010/11 times until now] (On my machine: AcerAspire5920g) ReactOS loading process stuck on line ...\Drivers\DISK.SYS when Disk operation mode in BIOS is set to AHCI. Changed the mode to IDE "workarounds" the problem: ntoskrnl.exe reaches the last line ...\Drivers\NDIS.SYS -- and is stuck somewhere more later -- eating 100% CPU. (//Debug-log is required)<br />
So the summary: SATA2 is not fully supported by ReactOS, forced to use IDE.<br />
<br />
* [http://jira.reactos.org/browse/CORE-8062 CORE-8062] Nasty bug made me thing my laptop monitor (matrix chip) or videocard goes fried with some code of reactos; Luckily it was just wrong settings somewhere there. Nasty bug; needed to be corrected by any mean.<br />
<br />
==MyBookmarks==<br />
Interesting topics, links (Started at 2011-04-03)<br />
<br />
Here I will keep links to forum topics, wiki pages or other, that seemed to be interesting:<br />
<br />
====(Generic) Development====<br />
* [http://jira.reactos.org/issues/?filter=-4 All issues of ReactOS] [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20ORDER%20BY%20createdDate%20DESC bugs only]<br />
* [[Missing ReactOS Functionality]] - major things absent of ROS from User PoV<br />
* [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20ORDER%20BY%20priority%20DESC%2C%20createdDate%20DESC Sorted by importance (''priority'' now in JIRA) bugs of ReactOS], excepto of resolved ones<br />
<br />
* [http://www.reactos.org/wiki/How_PnP_Works_in_ReactOS How PnP Works in ReactOS]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8459 ReactOS, how much money it requires?] - here is only the idea, to be converted to become more correct: "How many man-months?", given man-month is more like a myth, reconsider on per-project basis<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8126 HOWTO Become a Reactos Programmer?] - forum topic, could be converted to more constructive instruction<br />
* [http://dslab.epfl.ch/proj/reveng RevEng: Device Driver Reverse Engineering] from [http://www.reactos.org/forum/viewtopic.php?f=9&t=7990 here]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8206 Command-line-only Win32 from ReactOS?] The topic about full OS without GUI ("headless"?).<br />
** Resembles me idea of [http://hex.pp.ua/nt-native-applications-shell-eng.php Windows/ReactOS Native Shell]) ([http://www.reactos.org/forum/viewtopic.php?f=11&t=9092 Russian]).<br />
* [[Modify the final ISO image]] - good article, have also notes on how (bootcd) final CD-image is composed<br />
* [http://iso.reactos.org/bootcd/ bootcd repository] iso.reactos.org bootcd images<br />
* [http://iso.reactos.org/livecd/ livecd repository]<br />
<br />
* [[FreeLoader]], details, [[User:Mna./FreeLoader,_bootcd_and_bootrecords#FreeLoader_freeldr_Architecture|freeldr Architecture]] and related startup steps: [[User:Mna./FreeLoader,_bootcd_and_bootrecords|bootcd and bootrecords]]<br />
* [http://en.wikipedia.org/wiki/Windows_NT_Startup_Process Windows NT Startup Process/ Sequence]<br />
** [[User:Mna./ReactOS startup process light summary]]<br />
* [[How the system Finds and Loads Drivers]]<br />
* ROS build system hands-on:<br />
** [[Building_Modules#List_available_ninja_targets|available ninja targets]]<br />
** [[Building_Modules#Removing_or_Updating_a_Module|Updating a module code]] -- do this when the ROS module code was changed and build system didn't notice<br />
** Strange thing become clear; Ctrl+D doesn't work in 1st stage setup.<br />
BootOptions=DbgOsLoadOptions = "/NOGUIBOOT /DEBUGPORT=COM:io,0x3f8,115200n8 /DEBUGPORT=SCREEN" See also [[User:Mna./FreeLoader_freeldr_Architecture#Specifing_Boot_Options|Specifing Boot kernel Options]] ((Not confuse it with [[Boot_options#Options|Boot Options]]))<br />
* [irc://irc.freenode.net/reactos #reactos] - For general discussion and user support, most people are here<br />
<br />
====Filesystems generic====<br />
* [[File Systems]], a good page<br />
<br />
====Editing ReactOS registry offline====<br />
From [http://www.reactos.org/forum/viewtopic.php?t=3162 here]<br />
{| class="wikitable"<br />
|-<br />
| <br />
Editing ReactOS registry hives outside ReactOS?<br />
--2006-12<br />
<br />
> Is it possible at this moment to edit the registry hives outside the ReactOS environment?<br />
> I wanted to automate a process to load these registry hives onto the local registry, <br />
> add all my changes, unload the hives and create a new ISO.<br />
<br />
Simply change registry sources and build your own binary hives from them.<br />
<br />
by hto <br/><br />
<br />
> I guess "make" is the prefered way, there isn't any other method for creating these hives?<br /><br />
<br />
There is hive maker in tools\mkhive. You can build it with mingw32-make.exe mkhive<br />
<br />
Copy it from output-i386\tools\mkhive\mkhive.exe to (say) Windows\mkhive.exe.<br />
Then run this command:<br />
<br />
mkhive.exe boot\bootdata output-i386\livecd\reactos\system32\config boot\bootdata\livecd.inf boot\bootdata\hiveinst.inf<br />
<br />
Where output-i386\livecd\reactos\system32\config -- is output folder for hives.<br />
This is how ''make livecd'' does it.<br />
And yes, you can add your foo.inf to the end of that command.<br />
|}<br />
<br />
====NTFS====<br />
* post about [http://www.reactos.org/forum/viewtopic.php?f=9&t=8180#p71875 FUSE-lib creation attempts in ROS] in the "[http://www.reactos.org/forum/viewtopic.php?f=9&t=8180 NTFS question]" topic<br />
* (ru) [http://www.reactos.org/forum/viewtopic.php?f=11&t=8606 NTFS-3G applied to ROS], with ''unixed'' 's idea how to integrate into the '''fuse4win''' or '''dokan'''<br />
<br />
====Misc====<br />
* [http://alter.org.ua/soft/win/uni_ata/ UniATA] project link, Current version is 0.40b2, Updated @2011.03.24. ROS wasn't sinced with it since version-'?.?'...<br />
* [http://alter.org.ua/en/soft/win/vidcontrol/ Display Control for Windows], Alter's site; Now part of [http://alter.org.ua/en/soft/win/uictl/ UI ctl]<br />
<br />
===Serial extension card and MMIO programming===<br />
* [https://android.googlesource.com/kernel/omap/+/glass-omap-xrr02/drivers/tty/serial/8250_early.c android kernel driver tty-serial 8250_early.c] : as serial debug interface, Android can specify not only IO-ports, but also MMIO and MMIO32 addresses. The "shentek" serial card which I own, requires such communication method, it is based on Oxford chip and gives only mmio interface.<br />
* MMIO [http://en.wikipedia.org/wiki/Memory-mapped_I/O MMIO = Memory-mapped_I/O] Linux:[http://nouveau.freedesktop.org/wiki/MmioTrace/ MmioTrace Home] [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/trace/mmiotrace.txt mmiotrace doc]<br />
<br />
**'''Note: I have much info/hands-on to add here...'''<br />
<br />
===Debug prints in ROS===<br />
* [http://alter.org.ua/docs/nt_kernel/kdprint/ KdPrint/DbgPrint and OutputDebugString behavior] at Alter's site,<br />
* [http://www.codeproject.com/KB/winsdk/OutputDebugString.aspx?display=Print Mechanism of OutputDebugString - CodeProject] the ready code sample,<br />
They (articles) discuss internals and mechanism of OutputDebugString. Definitely Windows too (as unices) uses system calls to store and receive debug messages data to/from kernel debug messages buffer.<br />
<br />
** [http://www.reactos.org/wiki/Enable_kernel_tracing ROS: Enable kernel tracing]<br />
<br />
<br />
====Unix dmesg Internals Analysis====<br />
''for comparison and for creating something equivalent/analogous in ROS''<br />
Shortly:<br />
*'''Linux''' has special system call "'''syslog'''" (man 2 syslog)<br />
*'''FreeBSD''' uses its special '''sysctl''' interface to kernel along with "'''kern.msgbuf'''" parameter.<br />
<br />
'''D'''o we need special system call like Linux, or even more, the whole<br />
family of them (sysctl('*')) as in BSD?<br />
How to implement simple system call for it, now?<br />
<br />
---<br />
<br />
Detailed info for unices:<br />
<br />
'''Linux case''':<br />
* syslog(2) - read and/or clear kernel message ring buffer; set console_loglevel<br />
int syslog(int type, char *bufp, int len);<br />
* also /proc/kmsg virtual file, which when being read returns buffer contents<br />
<br />
Excerpt from "man proc":<br />
<pre><br />
/proc/kmsg<br />
This file can be used instead of the syslog(2) system<br />
call to read kernel messages. A<br />
process must have superuser privileges to read this<br />
file, and only one process should read<br />
this file. This file should not be read if a syslog<br />
process is running which uses the sys‐<br />
log(2) system call facility to log kernel messages.<br />
<br />
Information in this file is retrieved with the dmesg(1) program.<br />
</pre><br />
<br />
'''dmesg in FreeBSD''':<br />
*Parameter 'kern.msgbuf' given to sysctl(3) returns contents of kernel message buffer.<br />
*There is also 'kern.msgbuf_clear' to clean the buffer.<br />
<br />
<br />
====/*USB====<br />
These could be probably outdated in sense the USB now is in better working state.<br />
* [http://wiki.osdev.org/Main osdev.org wiki] - main page, [http://wiki.osdev.org/USB USB, the same place]<br />
* USB for NT4:<br />
** Alter's site reviews: [http://alter.org.ua/en/docs/win/nt4_usb/ en], [http://alter.org.ua/ru/docs/win/nt4_usb/ ru]<br />
** Woodheads opensource(!), GPL USB driver: [ftp://piekraste.daba.lv/pub/Service_Pack/NT_4/NT4_USB/HS/ files backed up] [http://www.geocities.com/mypublic99/index.html "Woodhead--NT4--USB" original link (dead)]<br />
** [http://nt4ref.zcm.com.au/usb.htm Windows NT 4.0 and USB] Quote: "Conclusion: I wish people would stop making comments like 'USB is not supported under NT4' - If you must comment please make it accurate, example: 'Microsoft have made the commercial decision not to provide NT4 USB support - but some manufacturers provide support for specific USB devices on NT4.'"<br />
<br />
====*/====<br />
<br />
<br />
=== FreeLoader, debug information, getting===<br />
Related with low-memory bug: 1) 4Gb was recognized as 25Mb 2) ROS started with 25Mb silently eat up 100% CPU and infinitely read from boot CD/HDD.<br />
* Debugging the FreeLdr: [http://jira.reactos.org/secure/attachment/16335/freeldr.patch freeldr.patch turning on debug mode] from [http://jira.reactos.org/browse/CORE-5462 CORE-5462] -- patch by ''rafalh''<br />
* [[FreeLoader]]<br />
<br />
Misc...<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=7915#p68991 by gabrielilardi @ 20 Jan 2010, forum of ROS]<br />
* [http://www.reactos.org/forum/viewtopic.php?p=62488#p62488 by hto @13 Jul 2009]<br />
<br />
===SVN how-to links===<br />
* [http://subversion.apache.org/faq.html] found through google [svn through proxy]<br />
* [http://www.mikepot.com/1544.html], same<br />
* SVN book: [http://svn.zen-cart.org.ua/documentation/en/book/svn-book.html Version Control with Subversion 1.2]<br />
** [http://svn.zen-cart.org.ua/documentation/ru/book/ Same SVN guide, russian]</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna.&diff=34707User:Mna.2014-04-05T09:54:37Z<p>Mna.: /* (Generic) Development */</p>
<hr />
<div>My patches to ReactOS// My Bookmarks with useful info// Future place for Manifest-like texts.<br />
<br />
==My Patches/WIP==<br />
''(WIP = Work in Progress)''<br />
* [Done] dmesg/kmesg command in ReactOS native kernel debugger [https://jira.reactos.org/browse/CORE-5452 CORE-5452], described there.<br />
** --<br />
* [Done/not-included] dmesg.exe User-mode utility: done. but not applied (.rbuild system was broken/removed then at the moment + 3 month delay of community considering accepting my kmesg patch).<br />
* WIP (Important thing): MMIO for serial card at kernel early-boot. -- MMIO serial cards doesn't work at all in ROS.<br />
* [Done] micropatch: print CPUs count and available RAM at ROS start (work related with low-memory related bug)<br />
* (..describe later..: partitions' bug, FAT32-moved-root-node, etc)<br />
* usetup.c - series: [http://jira.reactos.org/browse/CORE-7969 CORE-7969] submitted patch at 08.03.2014: will see how long it will stay not applied. (+1week later)<br />
<br />
==Issues: Reported and not yet==<br />
* [http://jira.reactos.org/browse/CORE-7978 CORE-7978] - ReactOS boot code of MBR can't boot USB-HDD due to error reading sectors with int13h_ah=42h<br />
** Added there link to very good explanation how does GRUB stage1 loader work! Just an amazingly detailed description (and also even with joke in stage2!) [http://thestarman.pcministry.com/asm/mbr/GRUB.htm This] link.<br />
** Workaround: use grub-2 to load freeldr.sys<br />
** freeldr.ini also requires editing the rdisk() parameter addressing the disks:<br />
SystemPath=multi(0)disk(0)rdisk(1)partition(2)\ReactOS<br />
<br />
rdisk(1)partition(2) here means: 2nd disk, 2nd partition. (partitions are 1-counted, rdisks - 0-counted.)<br />
<br />
* [Yet old bug of 2010/11 times until now] (On my machine: AcerAspire5920g) ReactOS loading process stuck on line ...\Drivers\DISK.SYS when Disk operation mode in BIOS is set to AHCI. Changed the mode to IDE "workarounds" the problem: ntoskrnl.exe reaches the last line ...\Drivers\NDIS.SYS -- and is stuck somewhere more later -- eating 100% CPU. (//Debug-log is required)<br />
So the summary: SATA2 is not fully supported by ReactOS, forced to use IDE.<br />
<br />
==MyBookmarks==<br />
Interesting topics, links (Started at 2011-04-03)<br />
<br />
Here I will keep links to forum topics, wiki pages or other, that seemed to be interesting:<br />
<br />
====(Generic) Development====<br />
* [http://jira.reactos.org/issues/?filter=-4 All issues of ReactOS] [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20ORDER%20BY%20createdDate%20DESC bugs only]<br />
* [[Missing ReactOS Functionality]] - major things absent of ROS from User PoV<br />
* [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20ORDER%20BY%20priority%20DESC%2C%20createdDate%20DESC Sorted by importance (''priority'' now in JIRA) bugs of ReactOS], excepto of resolved ones<br />
<br />
* [http://www.reactos.org/wiki/How_PnP_Works_in_ReactOS How PnP Works in ReactOS]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8459 ReactOS, how much money it requires?] - here is only the idea, to be converted to become more correct: "How many man-months?", given man-month is more like a myth, reconsider on per-project basis<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8126 HOWTO Become a Reactos Programmer?] - forum topic, could be converted to more constructive instruction<br />
* [http://dslab.epfl.ch/proj/reveng RevEng: Device Driver Reverse Engineering] from [http://www.reactos.org/forum/viewtopic.php?f=9&t=7990 here]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8206 Command-line-only Win32 from ReactOS?] The topic about full OS without GUI ("headless"?).<br />
** Resembles me idea of [http://hex.pp.ua/nt-native-applications-shell-eng.php Windows/ReactOS Native Shell]) ([http://www.reactos.org/forum/viewtopic.php?f=11&t=9092 Russian]).<br />
* [[Modify the final ISO image]] - good article, have also notes on how (bootcd) final CD-image is composed<br />
* [http://iso.reactos.org/bootcd/ bootcd repository] iso.reactos.org bootcd images<br />
* [http://iso.reactos.org/livecd/ livecd repository]<br />
<br />
* [[FreeLoader]], details, [[User:Mna./FreeLoader,_bootcd_and_bootrecords#FreeLoader_freeldr_Architecture|freeldr Architecture]] and related startup steps: [[User:Mna./FreeLoader,_bootcd_and_bootrecords|bootcd and bootrecords]]<br />
* [http://en.wikipedia.org/wiki/Windows_NT_Startup_Process Windows NT Startup Process/ Sequence]<br />
** [[User:Mna./ReactOS startup process light summary]]<br />
* [[How the system Finds and Loads Drivers]]<br />
* ROS build system hands-on:<br />
** [[Building_Modules#List_available_ninja_targets|available ninja targets]]<br />
** [[Building_Modules#Removing_or_Updating_a_Module|Updating a module code]] -- do this when the ROS module code was changed and build system didn't notice<br />
** Strange thing become clear; Ctrl+D doesn't work in 1st stage setup.<br />
BootOptions=DbgOsLoadOptions = "/NOGUIBOOT /DEBUGPORT=COM:io,0x3f8,115200n8 /DEBUGPORT=SCREEN" See also [[User:Mna./FreeLoader_freeldr_Architecture#Specifing_Boot_Options|Specifing Boot kernel Options]] ((Not confuse it with [[Boot_options#Options|Boot Options]]))<br />
* [irc://irc.freenode.net/reactos #reactos] - For general discussion and user support, most people are here<br />
<br />
====Filesystems generic====<br />
* [[File Systems]], a good page<br />
<br />
====Editing ReactOS registry offline====<br />
From [http://www.reactos.org/forum/viewtopic.php?t=3162 here]<br />
{| class="wikitable"<br />
|-<br />
| <br />
Editing ReactOS registry hives outside ReactOS?<br />
--2006-12<br />
<br />
> Is it possible at this moment to edit the registry hives outside the ReactOS environment?<br />
> I wanted to automate a process to load these registry hives onto the local registry, <br />
> add all my changes, unload the hives and create a new ISO.<br />
<br />
Simply change registry sources and build your own binary hives from them.<br />
<br />
by hto <br/><br />
<br />
> I guess "make" is the prefered way, there isn't any other method for creating these hives?<br /><br />
<br />
There is hive maker in tools\mkhive. You can build it with mingw32-make.exe mkhive<br />
<br />
Copy it from output-i386\tools\mkhive\mkhive.exe to (say) Windows\mkhive.exe.<br />
Then run this command:<br />
<br />
mkhive.exe boot\bootdata output-i386\livecd\reactos\system32\config boot\bootdata\livecd.inf boot\bootdata\hiveinst.inf<br />
<br />
Where output-i386\livecd\reactos\system32\config -- is output folder for hives.<br />
This is how ''make livecd'' does it.<br />
And yes, you can add your foo.inf to the end of that command.<br />
|}<br />
<br />
====NTFS====<br />
* post about [http://www.reactos.org/forum/viewtopic.php?f=9&t=8180#p71875 FUSE-lib creation attempts in ROS] in the "[http://www.reactos.org/forum/viewtopic.php?f=9&t=8180 NTFS question]" topic<br />
* (ru) [http://www.reactos.org/forum/viewtopic.php?f=11&t=8606 NTFS-3G applied to ROS], with ''unixed'' 's idea how to integrate into the '''fuse4win''' or '''dokan'''<br />
<br />
====Misc====<br />
* [http://alter.org.ua/soft/win/uni_ata/ UniATA] project link, Current version is 0.40b2, Updated @2011.03.24. ROS wasn't sinced with it since version-'?.?'...<br />
* [http://alter.org.ua/en/soft/win/vidcontrol/ Display Control for Windows], Alter's site; Now part of [http://alter.org.ua/en/soft/win/uictl/ UI ctl]<br />
<br />
===Serial extension card and MMIO programming===<br />
* [https://android.googlesource.com/kernel/omap/+/glass-omap-xrr02/drivers/tty/serial/8250_early.c android kernel driver tty-serial 8250_early.c] : as serial debug interface, Android can specify not only IO-ports, but also MMIO and MMIO32 addresses. The "shentek" serial card which I own, requires such communication method, it is based on Oxford chip and gives only mmio interface.<br />
* MMIO [http://en.wikipedia.org/wiki/Memory-mapped_I/O MMIO = Memory-mapped_I/O] Linux:[http://nouveau.freedesktop.org/wiki/MmioTrace/ MmioTrace Home] [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/trace/mmiotrace.txt mmiotrace doc]<br />
<br />
**'''Note: I have much info/hands-on to add here...'''<br />
<br />
===Debug prints in ROS===<br />
* [http://alter.org.ua/docs/nt_kernel/kdprint/ KdPrint/DbgPrint and OutputDebugString behavior] at Alter's site,<br />
* [http://www.codeproject.com/KB/winsdk/OutputDebugString.aspx?display=Print Mechanism of OutputDebugString - CodeProject] the ready code sample,<br />
They (articles) discuss internals and mechanism of OutputDebugString. Definitely Windows too (as unices) uses system calls to store and receive debug messages data to/from kernel debug messages buffer.<br />
<br />
** [http://www.reactos.org/wiki/Enable_kernel_tracing ROS: Enable kernel tracing]<br />
<br />
<br />
====Unix dmesg Internals Analysis====<br />
''for comparison and for creating something equivalent/analogous in ROS''<br />
Shortly:<br />
*'''Linux''' has special system call "'''syslog'''" (man 2 syslog)<br />
*'''FreeBSD''' uses its special '''sysctl''' interface to kernel along with "'''kern.msgbuf'''" parameter.<br />
<br />
'''D'''o we need special system call like Linux, or even more, the whole<br />
family of them (sysctl('*')) as in BSD?<br />
How to implement simple system call for it, now?<br />
<br />
---<br />
<br />
Detailed info for unices:<br />
<br />
'''Linux case''':<br />
* syslog(2) - read and/or clear kernel message ring buffer; set console_loglevel<br />
int syslog(int type, char *bufp, int len);<br />
* also /proc/kmsg virtual file, which when being read returns buffer contents<br />
<br />
Excerpt from "man proc":<br />
<pre><br />
/proc/kmsg<br />
This file can be used instead of the syslog(2) system<br />
call to read kernel messages. A<br />
process must have superuser privileges to read this<br />
file, and only one process should read<br />
this file. This file should not be read if a syslog<br />
process is running which uses the sys‐<br />
log(2) system call facility to log kernel messages.<br />
<br />
Information in this file is retrieved with the dmesg(1) program.<br />
</pre><br />
<br />
'''dmesg in FreeBSD''':<br />
*Parameter 'kern.msgbuf' given to sysctl(3) returns contents of kernel message buffer.<br />
*There is also 'kern.msgbuf_clear' to clean the buffer.<br />
<br />
<br />
====/*USB====<br />
These could be probably outdated in sense the USB now is in better working state.<br />
* [http://wiki.osdev.org/Main osdev.org wiki] - main page, [http://wiki.osdev.org/USB USB, the same place]<br />
* USB for NT4:<br />
** Alter's site reviews: [http://alter.org.ua/en/docs/win/nt4_usb/ en], [http://alter.org.ua/ru/docs/win/nt4_usb/ ru]<br />
** Woodheads opensource(!), GPL USB driver: [ftp://piekraste.daba.lv/pub/Service_Pack/NT_4/NT4_USB/HS/ files backed up] [http://www.geocities.com/mypublic99/index.html "Woodhead--NT4--USB" original link (dead)]<br />
** [http://nt4ref.zcm.com.au/usb.htm Windows NT 4.0 and USB] Quote: "Conclusion: I wish people would stop making comments like 'USB is not supported under NT4' - If you must comment please make it accurate, example: 'Microsoft have made the commercial decision not to provide NT4 USB support - but some manufacturers provide support for specific USB devices on NT4.'"<br />
<br />
====*/====<br />
<br />
<br />
=== FreeLoader, debug information, getting===<br />
Related with low-memory bug: 1) 4Gb was recognized as 25Mb 2) ROS started with 25Mb silently eat up 100% CPU and infinitely read from boot CD/HDD.<br />
* Debugging the FreeLdr: [http://jira.reactos.org/secure/attachment/16335/freeldr.patch freeldr.patch turning on debug mode] from [http://jira.reactos.org/browse/CORE-5462 CORE-5462] -- patch by ''rafalh''<br />
* [[FreeLoader]]<br />
<br />
Misc...<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=7915#p68991 by gabrielilardi @ 20 Jan 2010, forum of ROS]<br />
* [http://www.reactos.org/forum/viewtopic.php?p=62488#p62488 by hto @13 Jul 2009]<br />
<br />
===SVN how-to links===<br />
* [http://subversion.apache.org/faq.html] found through google [svn through proxy]<br />
* [http://www.mikepot.com/1544.html], same<br />
* SVN book: [http://svn.zen-cart.org.ua/documentation/en/book/svn-book.html Version Control with Subversion 1.2]<br />
** [http://svn.zen-cart.org.ua/documentation/ru/book/ Same SVN guide, russian]</div>Mna.https://reactos.org/wiki/index.php?title=Boot_options&diff=34706Boot options2014-04-05T09:53:02Z<p>Mna.: /* Options */</p>
<hr />
<div>''Other name'' '''''freeldr.ini options'''''<br />
<br />
The [[kernel]] command line is a text string that is passed to ReactOS by the boot loader (usually [[FreeLoader]]). It consists of several switches, each of which has a special meaning to ReactOS. A switch is a forward slash (<code>/</code>) followed by a text string (the name of the switch), and optionally an equal sign (<code>=</code>) and a text string (the value). If the equal sign is present, then at least one value is required to follow.<br />
<br />
The syntax, variables, and device strings used by FreeLoader conform to the [[Wikipedia:Advanced_RISC_Computing|ARC]] firmware and boot specification, similarly to the boot system used in all Windows NT implementations (such as the Windows NT boot loader on the x86 architecture, or the ARC console used to boot Windows NT 4.0 on the [[Wikipedia:Jazz_(computer)|MIPS]], Alpha AXP, and PowerPC architectures). Because of this, boot disks and other firmware- or BIOS-accessible devices are specified by each of the bus, disk, slice, and partition values associated with the device.<br />
<br />
In FreeLoader the kernel command line is specified in an <code>Options</code> setting in <tt>freeldr.ini</tt>. The following text is an example of the contents of <tt>freeldr.ini</tt>, which boots ReactOS from the first partition of the first IDE drive of the computer system:<br />
<syntaxhighlight lang="ini"><br />
[ReactOS]<br />
BootType=ReactOS<br />
SystemPath=multi(0)disk(0)rdisk(0)partition(1)\reactos<br />
Options=/DEBUGPORT=SCREEN<br />
</syntaxhighlight><br />
As used in the above sample file, <code>DEBUGPORT</code> is a boot option. By adding the boot option <code>/DEBUGREPORT=SCREEN</code>, ReactOS will print debugging information to the screen.<br />
<br />
=== Options ===<br />
The following boot options may be used:<br />
; <code>DEBUG</code> : Turn on debugging output. This option is automatically turned on when building debug version.<br />
To specify output device use <code>DEBUGPORT</code> option. If <code>DEBUGPORT</code> is not specified output by default goes to <code>COM1</code>.<br />
* Format: <code>DEBUG</code><br />
<br />
; <code>DEBUGPORT</code> : Specifying <code>DEBUGPORT</code> as a boot option will enable certain debugging features.<br />
* Format: <code>DEBUGPORT=[SCREEN|BOCHS|GDB|PICE|COM1|COM2|COM3|COM4|COM:|FILE|MDA]</code><br>Any one of the following values may set:<br />
** <code>SCREEN</code>: Send debug output to the screen.<br />
** <code>BOCHS</code>: Send debug output to bochs.<br />
** <code>GDB</code>: Enable the GNU debugger (GDB) stub so remote debugging using GDB is possible.<br />
** <code>PICE</code>: Enable the Private ICE driver so debugging using Private ICE is possible.<br />
** <code>COM1</code>: Send debug output to COM1.<br />
** <code>COM2</code>: Send debug output to COM2.<br />
** <code>COM3</code>: Send debug output to COM3.<br />
** <code>COM4</code>: Send debug output to COM4.<br />
** <code>COM:[hex address]</code>: Specifies the COM I/O port address. (Example: /DEBUGPORT=COM:0xCC00 --here 0xCC00 is [[On COM Ports|base]] I/O port number)<br />
** <code>FILE</code>: Send debug output to a file %systemroot%/reactos/debug.log <br />
** <code>MDA</code>: Send debug output to MDA ''(The old text graphic card from IBM)''.<br />
It is allowed to use several <code>DEBUGPORT</code> options, but for ports of the same class, for example, COM ports, only the one (last one) will be used for output.<br />
<br />
; <code>BAUDRATE</code> : Specifies baudrate of the serial port to be <code>[baudrate]</code> bps. Used in conjunction with <code>COM1-4</code> or <code>GDB</code>.<br />
* Format: <code>BAUDRATE=[baudrate]</code><br />
<br />
; <code>IRQ</code> : Specifies the IRQ number of the serial port to be <code>[irq-number]</code>. Used in conjunction with <code>COM1-4</code> or <code>GDB</code>.<br />
* Format: <code>IRQ=[irq-number]</code><br />
<br />
; <code>PROFILE</code> : Enables profiling. Profiling information will be written in <code>%windir%\profiler.log</code>. This will slow down the system quite a bit.<br />
* Format: <code>PROFILE</code><br />
<br />
; <code>MAXMEM</code> : Will restrict ReactOS to use only the first <code>[maxmem]</code> MB of physical memory.<br />
* Format: <code>MAXMEM=[maxmem]</code><br />
<br />
; <code>NOGUIBOOT</code> : disables the bitmap that displays the progress bar at ReactOS startup.<br />
; <code>FIRSTCHANCE</code> : Set up exceptions to be passed to debugger on its occurrence, before being handled by regular exception handling code.<br />
; <code>MININT</code>: loads the Registry SYSTEM hive as a volatile hive, such, that changes made to it in memory are not saved back to the hive image, into registry file. Useful for running ReactOS from liveCD.<br />
; <code>SOS</code>: The /SOS parameter displays the names of the drivers as they load during the boot process.<br />
<br />
See also: [http://en.wikipedia.org/wiki/NTLDR List of Windows NTLDR options] (Wikipedia link)</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna./ReactOS_startup_process_light_summary&diff=34688User:Mna./ReactOS startup process light summary2014-03-27T13:34:01Z<p>Mna.: Created page with "*** Freeldr loads: ROS kernel Ntoskrnl.exe, Hardware Abstraction Layer) hal.dll, language files, and registry's system hive. *** Registry: ''HKEY_LOCAL_MACHINE\System'' contai..."</p>
<hr />
<div>*** Freeldr loads: ROS kernel Ntoskrnl.exe, Hardware Abstraction Layer) hal.dll, language files, and registry's system hive.<br />
*** Registry:<br />
''HKEY_LOCAL_MACHINE\System'' contains control sets labeled ControlSet001, ControlSet002, etc., as well as ''CurrentControlSet''. During regular operation, Windows uses CurrentControlSet to read and write information. CurrentControlSet is a reference to one of the control sets stored in the registry. Windows picks the "real" control set being used based on the values set in the HKLM\SYSTEM\Select registry key: ''Default'' will be the boot loader's choice if nothing else overrides this<br />
<br />
*** When a control set is chosen, the Current key gets set accordingly.<br />
*** Which services are started and the order each group is started are provided by the following keys:<br />
<br />
**** HKLM\SYSTEM\CurrentControlSet\Services<br />
<br />
**** HKLM\SYSTEM\CurrentControlSet\Control\ServiceGroupOrder<br />
<br />
For the purposes of booting, a driver may be one of the following:<br />
# A "Boot" driver that is loaded by the boot loader prior to starting the kernel. "Boot" drivers are almost exclusively drivers for hard-disk controllers and file systems (ATA, SCSI, file system filter manager, etc.); in other words, they are the absolute minimum that the kernel will need to get started with loading other drivers, and the rest of the operating system.<br />
<br />
# A "System" driver which is loaded and started by the kernel after the boot drivers. "System" drivers cover a wider range of core functionality, including the display driver, CD-ROM support, and the TCP/IP stack.<br />
<br />
# An "Automatic" driver which is loaded much later when the GUI already has been started.</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna.&diff=34687User:Mna.2014-03-27T13:32:07Z<p>Mna.: /* (Generic) Development */</p>
<hr />
<div>My patches to ReactOS// My Bookmarks with useful info// Future place for Manifest-like texts.<br />
<br />
==My Patches/WIP==<br />
''(WIP = Work in Progress)''<br />
* [Done] dmesg/kmesg command in ReactOS native kernel debugger [https://jira.reactos.org/browse/CORE-5452 CORE-5452], described there.<br />
** --<br />
* [Done/not-included] dmesg.exe User-mode utility: done. but not applied (.rbuild system was broken/removed then at the moment + 3 month delay of community considering accepting my kmesg patch).<br />
* WIP (Important thing): MMIO for serial card at kernel early-boot. -- MMIO serial cards doesn't work at all in ROS.<br />
* [Done] micropatch: print CPUs count and available RAM at ROS start (work related with low-memory related bug)<br />
* (..describe later..: partitions' bug, FAT32-moved-root-node, etc)<br />
* usetup.c - series: [http://jira.reactos.org/browse/CORE-7969 CORE-7969] submitted patch at 08.03.2014: will see how long it will stay not applied. (+1week later)<br />
<br />
==Issues: Reported and not yet==<br />
* [http://jira.reactos.org/browse/CORE-7978 CORE-7978] - ReactOS boot code of MBR can't boot USB-HDD due to error reading sectors with int13h_ah=42h<br />
** Added there link to very good explanation how does GRUB stage1 loader work! Just an amazingly detailed description (and also even with joke in stage2!) [http://thestarman.pcministry.com/asm/mbr/GRUB.htm This] link.<br />
** Workaround: use grub-2 to load freeldr.sys<br />
** freeldr.ini also requires editing the rdisk() parameter addressing the disks:<br />
SystemPath=multi(0)disk(0)rdisk(1)partition(2)\ReactOS<br />
<br />
rdisk(1)partition(2) here means: 2nd disk, 2nd partition. (partitions are 1-counted, rdisks - 0-counted.)<br />
<br />
* [Yet old bug of 2010/11 times until now] (On my machine: AcerAspire5920g) ReactOS loading process stuck on line ...\Drivers\DISK.SYS when Disk operation mode in BIOS is set to AHCI. Changed the mode to IDE "workarounds" the problem: ntoskrnl.exe reaches the last line ...\Drivers\NDIS.SYS -- and is stuck somewhere more later -- eating 100% CPU. (//Debug-log is required)<br />
So the summary: SATA2 is not fully supported by ReactOS, forced to use IDE.<br />
<br />
==MyBookmarks==<br />
Interesting topics, links (Started at 2011-04-03)<br />
<br />
Here I will keep links to forum topics, wiki pages or other, that seemed to be interesting:<br />
<br />
====(Generic) Development====<br />
* [http://jira.reactos.org/issues/?filter=-4 All issues of ReactOS] [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20ORDER%20BY%20createdDate%20DESC bugs only]<br />
* [[Missing ReactOS Functionality]] - major things absent of ROS from User PoV<br />
* [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20ORDER%20BY%20priority%20DESC%2C%20createdDate%20DESC Sorted by importance (''priority'' now in JIRA) bugs of ReactOS], excepto of resolved ones<br />
<br />
* [http://www.reactos.org/wiki/How_PnP_Works_in_ReactOS How PnP Works in ReactOS]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8459 ReactOS, how much money it requires?] - here is only the idea, to be converted to become more correct: "How many man-months?", given man-month is more like a myth, reconsider on per-project basis<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8126 HOWTO Become a Reactos Programmer?] - forum topic, could be converted to more constructive instruction<br />
* [http://dslab.epfl.ch/proj/reveng RevEng: Device Driver Reverse Engineering] from [http://www.reactos.org/forum/viewtopic.php?f=9&t=7990 here]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8206 Command-line-only Win32 from ReactOS?] The topic about full OS without GUI ("headless"?).<br />
** Resembles me idea of [http://hex.pp.ua/nt-native-applications-shell-eng.php Windows/ReactOS Native Shell]) ([http://www.reactos.org/forum/viewtopic.php?f=11&t=9092 Russian]).<br />
* [[Modify the final ISO image]] - good article, have also notes on how (bootcd) final CD-image is composed<br />
* [http://iso.reactos.org/bootcd/ bootcd repository] iso.reactos.org bootcd images<br />
* [http://iso.reactos.org/livecd/ livecd repository]<br />
<br />
* [[FreeLoader]], details, [[User:Mna./FreeLoader,_bootcd_and_bootrecords#FreeLoader_freeldr_Architecture|freeldr Architecture]] and related startup steps: [[User:Mna./FreeLoader,_bootcd_and_bootrecords|bootcd and bootrecords]]<br />
* [http://en.wikipedia.org/wiki/Windows_NT_Startup_Process Windows NT Startup Process/ Sequence]<br />
** [[User:Mna./ReactOS startup process light summary]]<br />
* [[How the system Finds and Loads Drivers]]<br />
* ROS build system hands-on:<br />
** [[Building_Modules#List_available_ninja_targets|available ninja targets]]<br />
** [[Building_Modules#Removing_or_Updating_a_Module|Updating a module code]] -- do this when the ROS module code was changed and build system didn't notice<br />
** Strange thing become clear; Ctrl+D doesn't work in 1st stage setup.<br />
BootOptions=DbgOsLoadOptions = "/NOGUIBOOT /DEBUGPORT=COM:io,0x3f8,115200n8 /DEBUGPORT=SCREEN" See also [[User:Mna./FreeLoader_freeldr_Architecture#Specifing_Boot_Options|Specifing Boot kernel Options]]<br />
* [irc://irc.freenode.net/reactos #reactos] - For general discussion and user support, most people are here<br />
<br />
====Filesystems generic====<br />
* [[File Systems]], a good page<br />
<br />
====Editing ReactOS registry offline====<br />
From [http://www.reactos.org/forum/viewtopic.php?t=3162 here]<br />
{| class="wikitable"<br />
|-<br />
| <br />
Editing ReactOS registry hives outside ReactOS?<br />
--2006-12<br />
<br />
> Is it possible at this moment to edit the registry hives outside the ReactOS environment?<br />
> I wanted to automate a process to load these registry hives onto the local registry, <br />
> add all my changes, unload the hives and create a new ISO.<br />
<br />
Simply change registry sources and build your own binary hives from them.<br />
<br />
by hto <br/><br />
<br />
> I guess "make" is the prefered way, there isn't any other method for creating these hives?<br /><br />
<br />
There is hive maker in tools\mkhive. You can build it with mingw32-make.exe mkhive<br />
<br />
Copy it from output-i386\tools\mkhive\mkhive.exe to (say) Windows\mkhive.exe.<br />
Then run this command:<br />
<br />
mkhive.exe boot\bootdata output-i386\livecd\reactos\system32\config boot\bootdata\livecd.inf boot\bootdata\hiveinst.inf<br />
<br />
Where output-i386\livecd\reactos\system32\config -- is output folder for hives.<br />
This is how ''make livecd'' does it.<br />
And yes, you can add your foo.inf to the end of that command.<br />
|}<br />
<br />
====NTFS====<br />
* post about [http://www.reactos.org/forum/viewtopic.php?f=9&t=8180#p71875 FUSE-lib creation attempts in ROS] in the "[http://www.reactos.org/forum/viewtopic.php?f=9&t=8180 NTFS question]" topic<br />
* (ru) [http://www.reactos.org/forum/viewtopic.php?f=11&t=8606 NTFS-3G applied to ROS], with ''unixed'' 's idea how to integrate into the '''fuse4win''' or '''dokan'''<br />
<br />
====Misc====<br />
* [http://alter.org.ua/soft/win/uni_ata/ UniATA] project link, Current version is 0.40b2, Updated @2011.03.24. ROS wasn't sinced with it since version-'?.?'...<br />
* [http://alter.org.ua/en/soft/win/vidcontrol/ Display Control for Windows], Alter's site; Now part of [http://alter.org.ua/en/soft/win/uictl/ UI ctl]<br />
<br />
===Serial extension card and MMIO programming===<br />
* [https://android.googlesource.com/kernel/omap/+/glass-omap-xrr02/drivers/tty/serial/8250_early.c android kernel driver tty-serial 8250_early.c] : as serial debug interface, Android can specify not only IO-ports, but also MMIO and MMIO32 addresses. The "shentek" serial card which I own, requires such communication method, it is based on Oxford chip and gives only mmio interface.<br />
* MMIO [http://en.wikipedia.org/wiki/Memory-mapped_I/O MMIO = Memory-mapped_I/O] Linux:[http://nouveau.freedesktop.org/wiki/MmioTrace/ MmioTrace Home] [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/trace/mmiotrace.txt mmiotrace doc]<br />
<br />
**'''Note: I have much info/hands-on to add here...'''<br />
<br />
===Debug prints in ROS===<br />
* [http://alter.org.ua/docs/nt_kernel/kdprint/ KdPrint/DbgPrint and OutputDebugString behavior] at Alter's site,<br />
* [http://www.codeproject.com/KB/winsdk/OutputDebugString.aspx?display=Print Mechanism of OutputDebugString - CodeProject] the ready code sample,<br />
They (articles) discuss internals and mechanism of OutputDebugString. Definitely Windows too (as unices) uses system calls to store and receive debug messages data to/from kernel debug messages buffer.<br />
<br />
** [http://www.reactos.org/wiki/Enable_kernel_tracing ROS: Enable kernel tracing]<br />
<br />
<br />
====Unix dmesg Internals Analysis====<br />
''for comparison and for creating something equivalent/analogous in ROS''<br />
Shortly:<br />
*'''Linux''' has special system call "'''syslog'''" (man 2 syslog)<br />
*'''FreeBSD''' uses its special '''sysctl''' interface to kernel along with "'''kern.msgbuf'''" parameter.<br />
<br />
'''D'''o we need special system call like Linux, or even more, the whole<br />
family of them (sysctl('*')) as in BSD?<br />
How to implement simple system call for it, now?<br />
<br />
---<br />
<br />
Detailed info for unices:<br />
<br />
'''Linux case''':<br />
* syslog(2) - read and/or clear kernel message ring buffer; set console_loglevel<br />
int syslog(int type, char *bufp, int len);<br />
* also /proc/kmsg virtual file, which when being read returns buffer contents<br />
<br />
Excerpt from "man proc":<br />
<pre><br />
/proc/kmsg<br />
This file can be used instead of the syslog(2) system<br />
call to read kernel messages. A<br />
process must have superuser privileges to read this<br />
file, and only one process should read<br />
this file. This file should not be read if a syslog<br />
process is running which uses the sys‐<br />
log(2) system call facility to log kernel messages.<br />
<br />
Information in this file is retrieved with the dmesg(1) program.<br />
</pre><br />
<br />
'''dmesg in FreeBSD''':<br />
*Parameter 'kern.msgbuf' given to sysctl(3) returns contents of kernel message buffer.<br />
*There is also 'kern.msgbuf_clear' to clean the buffer.<br />
<br />
<br />
====/*USB====<br />
These could be probably outdated in sense the USB now is in better working state.<br />
* [http://wiki.osdev.org/Main osdev.org wiki] - main page, [http://wiki.osdev.org/USB USB, the same place]<br />
* USB for NT4:<br />
** Alter's site reviews: [http://alter.org.ua/en/docs/win/nt4_usb/ en], [http://alter.org.ua/ru/docs/win/nt4_usb/ ru]<br />
** Woodheads opensource(!), GPL USB driver: [ftp://piekraste.daba.lv/pub/Service_Pack/NT_4/NT4_USB/HS/ files backed up] [http://www.geocities.com/mypublic99/index.html "Woodhead--NT4--USB" original link (dead)]<br />
** [http://nt4ref.zcm.com.au/usb.htm Windows NT 4.0 and USB] Quote: "Conclusion: I wish people would stop making comments like 'USB is not supported under NT4' - If you must comment please make it accurate, example: 'Microsoft have made the commercial decision not to provide NT4 USB support - but some manufacturers provide support for specific USB devices on NT4.'"<br />
<br />
====*/====<br />
<br />
<br />
=== FreeLoader, debug information, getting===<br />
Related with low-memory bug: 1) 4Gb was recognized as 25Mb 2) ROS started with 25Mb silently eat up 100% CPU and infinitely read from boot CD/HDD.<br />
* Debugging the FreeLdr: [http://jira.reactos.org/secure/attachment/16335/freeldr.patch freeldr.patch turning on debug mode] from [http://jira.reactos.org/browse/CORE-5462 CORE-5462] -- patch by ''rafalh''<br />
* [[FreeLoader]]<br />
<br />
Misc...<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=7915#p68991 by gabrielilardi @ 20 Jan 2010, forum of ROS]<br />
* [http://www.reactos.org/forum/viewtopic.php?p=62488#p62488 by hto @13 Jul 2009]<br />
<br />
===SVN how-to links===<br />
* [http://subversion.apache.org/faq.html] found through google [svn through proxy]<br />
* [http://www.mikepot.com/1544.html], same<br />
* SVN book: [http://svn.zen-cart.org.ua/documentation/en/book/svn-book.html Version Control with Subversion 1.2]<br />
** [http://svn.zen-cart.org.ua/documentation/ru/book/ Same SVN guide, russian]</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna.&diff=34686User:Mna.2014-03-27T04:43:11Z<p>Mna.: /* (Generic) Development */</p>
<hr />
<div>My patches to ReactOS// My Bookmarks with useful info// Future place for Manifest-like texts.<br />
<br />
==My Patches/WIP==<br />
''(WIP = Work in Progress)''<br />
* [Done] dmesg/kmesg command in ReactOS native kernel debugger [https://jira.reactos.org/browse/CORE-5452 CORE-5452], described there.<br />
** --<br />
* [Done/not-included] dmesg.exe User-mode utility: done. but not applied (.rbuild system was broken/removed then at the moment + 3 month delay of community considering accepting my kmesg patch).<br />
* WIP (Important thing): MMIO for serial card at kernel early-boot. -- MMIO serial cards doesn't work at all in ROS.<br />
* [Done] micropatch: print CPUs count and available RAM at ROS start (work related with low-memory related bug)<br />
* (..describe later..: partitions' bug, FAT32-moved-root-node, etc)<br />
* usetup.c - series: [http://jira.reactos.org/browse/CORE-7969 CORE-7969] submitted patch at 08.03.2014: will see how long it will stay not applied. (+1week later)<br />
<br />
==Issues: Reported and not yet==<br />
* [http://jira.reactos.org/browse/CORE-7978 CORE-7978] - ReactOS boot code of MBR can't boot USB-HDD due to error reading sectors with int13h_ah=42h<br />
** Added there link to very good explanation how does GRUB stage1 loader work! Just an amazingly detailed description (and also even with joke in stage2!) [http://thestarman.pcministry.com/asm/mbr/GRUB.htm This] link.<br />
** Workaround: use grub-2 to load freeldr.sys<br />
** freeldr.ini also requires editing the rdisk() parameter addressing the disks:<br />
SystemPath=multi(0)disk(0)rdisk(1)partition(2)\ReactOS<br />
<br />
rdisk(1)partition(2) here means: 2nd disk, 2nd partition. (partitions are 1-counted, rdisks - 0-counted.)<br />
<br />
* [Yet old bug of 2010/11 times until now] (On my machine: AcerAspire5920g) ReactOS loading process stuck on line ...\Drivers\DISK.SYS when Disk operation mode in BIOS is set to AHCI. Changed the mode to IDE "workarounds" the problem: ntoskrnl.exe reaches the last line ...\Drivers\NDIS.SYS -- and is stuck somewhere more later -- eating 100% CPU. (//Debug-log is required)<br />
So the summary: SATA2 is not fully supported by ReactOS, forced to use IDE.<br />
<br />
==MyBookmarks==<br />
Interesting topics, links (Started at 2011-04-03)<br />
<br />
Here I will keep links to forum topics, wiki pages or other, that seemed to be interesting:<br />
<br />
====(Generic) Development====<br />
* [http://jira.reactos.org/issues/?filter=-4 All issues of ReactOS] [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20ORDER%20BY%20createdDate%20DESC bugs only]<br />
* [[Missing ReactOS Functionality]] - major things absent of ROS from User PoV<br />
* [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20ORDER%20BY%20priority%20DESC%2C%20createdDate%20DESC Sorted by importance (''priority'' now in JIRA) bugs of ReactOS], excepto of resolved ones<br />
<br />
* [http://www.reactos.org/wiki/How_PnP_Works_in_ReactOS How PnP Works in ReactOS]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8459 ReactOS, how much money it requires?] - here is only the idea, to be converted to become more correct: "How many man-months?", given man-month is more like a myth, reconsider on per-project basis<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8126 HOWTO Become a Reactos Programmer?] - forum topic, could be converted to more constructive instruction<br />
* [http://dslab.epfl.ch/proj/reveng RevEng: Device Driver Reverse Engineering] from [http://www.reactos.org/forum/viewtopic.php?f=9&t=7990 here]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8206 Command-line-only Win32 from ReactOS?] The topic about full OS without GUI ("headless"?).<br />
** Resembles me idea of [http://hex.pp.ua/nt-native-applications-shell-eng.php Windows/ReactOS Native Shell]) ([http://www.reactos.org/forum/viewtopic.php?f=11&t=9092 Russian]).<br />
* [[Modify the final ISO image]] - good article, have also notes on how (bootcd) final CD-image is composed<br />
* [http://iso.reactos.org/bootcd/ bootcd repository] iso.reactos.org bootcd images<br />
* [http://iso.reactos.org/livecd/ livecd repository]<br />
<br />
* [[FreeLoader]], details, [[User:Mna./FreeLoader,_bootcd_and_bootrecords#FreeLoader_freeldr_Architecture|freeldr Architecture]] and related startup steps: [[User:Mna./FreeLoader,_bootcd_and_bootrecords|bootcd and bootrecords]]<br />
* [http://en.wikipedia.org/wiki/Windows_NT_Startup_Process Windows NT Startup Process/ Sequence]<br />
* [[How the system Finds and Loads Drivers]]<br />
* ROS build system hands-on:<br />
** [[Building_Modules#List_available_ninja_targets|available ninja targets]]<br />
** [[Building_Modules#Removing_or_Updating_a_Module|Updating a module code]] -- do this when the ROS module code was changed and build system didn't notice<br />
** Strange thing become clear; Ctrl+D doesn't work in 1st stage setup.<br />
BootOptions=DbgOsLoadOptions = "/NOGUIBOOT /DEBUGPORT=COM:io,0x3f8,115200n8 /DEBUGPORT=SCREEN" See also [[User:Mna./FreeLoader_freeldr_Architecture#Specifing_Boot_Options|Specifing Boot kernel Options]]<br />
* [irc://irc.freenode.net/reactos #reactos] - For general discussion and user support, most people are here<br />
<br />
====Filesystems generic====<br />
* [[File Systems]], a good page<br />
<br />
====Editing ReactOS registry offline====<br />
From [http://www.reactos.org/forum/viewtopic.php?t=3162 here]<br />
{| class="wikitable"<br />
|-<br />
| <br />
Editing ReactOS registry hives outside ReactOS?<br />
--2006-12<br />
<br />
> Is it possible at this moment to edit the registry hives outside the ReactOS environment?<br />
> I wanted to automate a process to load these registry hives onto the local registry, <br />
> add all my changes, unload the hives and create a new ISO.<br />
<br />
Simply change registry sources and build your own binary hives from them.<br />
<br />
by hto <br/><br />
<br />
> I guess "make" is the prefered way, there isn't any other method for creating these hives?<br /><br />
<br />
There is hive maker in tools\mkhive. You can build it with mingw32-make.exe mkhive<br />
<br />
Copy it from output-i386\tools\mkhive\mkhive.exe to (say) Windows\mkhive.exe.<br />
Then run this command:<br />
<br />
mkhive.exe boot\bootdata output-i386\livecd\reactos\system32\config boot\bootdata\livecd.inf boot\bootdata\hiveinst.inf<br />
<br />
Where output-i386\livecd\reactos\system32\config -- is output folder for hives.<br />
This is how ''make livecd'' does it.<br />
And yes, you can add your foo.inf to the end of that command.<br />
|}<br />
<br />
====NTFS====<br />
* post about [http://www.reactos.org/forum/viewtopic.php?f=9&t=8180#p71875 FUSE-lib creation attempts in ROS] in the "[http://www.reactos.org/forum/viewtopic.php?f=9&t=8180 NTFS question]" topic<br />
* (ru) [http://www.reactos.org/forum/viewtopic.php?f=11&t=8606 NTFS-3G applied to ROS], with ''unixed'' 's idea how to integrate into the '''fuse4win''' or '''dokan'''<br />
<br />
====Misc====<br />
* [http://alter.org.ua/soft/win/uni_ata/ UniATA] project link, Current version is 0.40b2, Updated @2011.03.24. ROS wasn't sinced with it since version-'?.?'...<br />
* [http://alter.org.ua/en/soft/win/vidcontrol/ Display Control for Windows], Alter's site; Now part of [http://alter.org.ua/en/soft/win/uictl/ UI ctl]<br />
<br />
===Serial extension card and MMIO programming===<br />
* [https://android.googlesource.com/kernel/omap/+/glass-omap-xrr02/drivers/tty/serial/8250_early.c android kernel driver tty-serial 8250_early.c] : as serial debug interface, Android can specify not only IO-ports, but also MMIO and MMIO32 addresses. The "shentek" serial card which I own, requires such communication method, it is based on Oxford chip and gives only mmio interface.<br />
* MMIO [http://en.wikipedia.org/wiki/Memory-mapped_I/O MMIO = Memory-mapped_I/O] Linux:[http://nouveau.freedesktop.org/wiki/MmioTrace/ MmioTrace Home] [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/trace/mmiotrace.txt mmiotrace doc]<br />
<br />
**'''Note: I have much info/hands-on to add here...'''<br />
<br />
===Debug prints in ROS===<br />
* [http://alter.org.ua/docs/nt_kernel/kdprint/ KdPrint/DbgPrint and OutputDebugString behavior] at Alter's site,<br />
* [http://www.codeproject.com/KB/winsdk/OutputDebugString.aspx?display=Print Mechanism of OutputDebugString - CodeProject] the ready code sample,<br />
They (articles) discuss internals and mechanism of OutputDebugString. Definitely Windows too (as unices) uses system calls to store and receive debug messages data to/from kernel debug messages buffer.<br />
<br />
** [http://www.reactos.org/wiki/Enable_kernel_tracing ROS: Enable kernel tracing]<br />
<br />
<br />
====Unix dmesg Internals Analysis====<br />
''for comparison and for creating something equivalent/analogous in ROS''<br />
Shortly:<br />
*'''Linux''' has special system call "'''syslog'''" (man 2 syslog)<br />
*'''FreeBSD''' uses its special '''sysctl''' interface to kernel along with "'''kern.msgbuf'''" parameter.<br />
<br />
'''D'''o we need special system call like Linux, or even more, the whole<br />
family of them (sysctl('*')) as in BSD?<br />
How to implement simple system call for it, now?<br />
<br />
---<br />
<br />
Detailed info for unices:<br />
<br />
'''Linux case''':<br />
* syslog(2) - read and/or clear kernel message ring buffer; set console_loglevel<br />
int syslog(int type, char *bufp, int len);<br />
* also /proc/kmsg virtual file, which when being read returns buffer contents<br />
<br />
Excerpt from "man proc":<br />
<pre><br />
/proc/kmsg<br />
This file can be used instead of the syslog(2) system<br />
call to read kernel messages. A<br />
process must have superuser privileges to read this<br />
file, and only one process should read<br />
this file. This file should not be read if a syslog<br />
process is running which uses the sys‐<br />
log(2) system call facility to log kernel messages.<br />
<br />
Information in this file is retrieved with the dmesg(1) program.<br />
</pre><br />
<br />
'''dmesg in FreeBSD''':<br />
*Parameter 'kern.msgbuf' given to sysctl(3) returns contents of kernel message buffer.<br />
*There is also 'kern.msgbuf_clear' to clean the buffer.<br />
<br />
<br />
====/*USB====<br />
These could be probably outdated in sense the USB now is in better working state.<br />
* [http://wiki.osdev.org/Main osdev.org wiki] - main page, [http://wiki.osdev.org/USB USB, the same place]<br />
* USB for NT4:<br />
** Alter's site reviews: [http://alter.org.ua/en/docs/win/nt4_usb/ en], [http://alter.org.ua/ru/docs/win/nt4_usb/ ru]<br />
** Woodheads opensource(!), GPL USB driver: [ftp://piekraste.daba.lv/pub/Service_Pack/NT_4/NT4_USB/HS/ files backed up] [http://www.geocities.com/mypublic99/index.html "Woodhead--NT4--USB" original link (dead)]<br />
** [http://nt4ref.zcm.com.au/usb.htm Windows NT 4.0 and USB] Quote: "Conclusion: I wish people would stop making comments like 'USB is not supported under NT4' - If you must comment please make it accurate, example: 'Microsoft have made the commercial decision not to provide NT4 USB support - but some manufacturers provide support for specific USB devices on NT4.'"<br />
<br />
====*/====<br />
<br />
<br />
=== FreeLoader, debug information, getting===<br />
Related with low-memory bug: 1) 4Gb was recognized as 25Mb 2) ROS started with 25Mb silently eat up 100% CPU and infinitely read from boot CD/HDD.<br />
* Debugging the FreeLdr: [http://jira.reactos.org/secure/attachment/16335/freeldr.patch freeldr.patch turning on debug mode] from [http://jira.reactos.org/browse/CORE-5462 CORE-5462] -- patch by ''rafalh''<br />
* [[FreeLoader]]<br />
<br />
Misc...<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=7915#p68991 by gabrielilardi @ 20 Jan 2010, forum of ROS]<br />
* [http://www.reactos.org/forum/viewtopic.php?p=62488#p62488 by hto @13 Jul 2009]<br />
<br />
===SVN how-to links===<br />
* [http://subversion.apache.org/faq.html] found through google [svn through proxy]<br />
* [http://www.mikepot.com/1544.html], same<br />
* SVN book: [http://svn.zen-cart.org.ua/documentation/en/book/svn-book.html Version Control with Subversion 1.2]<br />
** [http://svn.zen-cart.org.ua/documentation/ru/book/ Same SVN guide, russian]</div>Mna.https://reactos.org/wiki/index.php?title=How_the_system_Finds_and_Loads_Drivers&diff=34684How the system Finds and Loads Drivers2014-03-27T04:39:17Z<p>Mna.: Mna. moved page User:Mna./How the system Finds and Loads Drivers to How the system Finds and Loads Drivers: It's ready</p>
<hr />
<div>=How the system Finds and Loads Drivers=<br />
<br />
original: http://blogs.msdn.com/b/xiz/archive/2013/11/04/how-the-system-finds-and-loads-drivers.aspx<br />
<br />
===Device types===<br />
'''1. PnP device'''<br />
<br />
It has an electronic signature that bus driver can detect the new hardware<br />
<br />
<br />
'''2. Legacy device'''<br />
<br />
Initiate the detection by invoking Add New Hardware Wizard.<br />
<br />
In the end, in both PnP and Legacy Device situation, system uses the same automatic registry and INF file process to load the right driver.<br />
<br />
===Driver types===<br />
'''Function driver:'''<br />
<br />
It understands the details about how to make the HW work.<br />
<br />
It's responsible for initiating IO operations, for handling interrupts, and for providing a way for end user to exercise control over the device.<br />
<br />
'''Bus driver:'''<br />
<br />
It's responsible for managing the connection between the Hardware and the computer.<br />
<br />
'''Filter Driver:'''<br />
<br />
is to Modify the behavior of an existing function driver in some way. Upper filter driver sees IRPs before function driver. Lower filter can modify the stream of bus operations that the function driver is trying to perform.<br />
<br />
'''PDO''' stands for '''P'''hysical '''D'''evice '''O'''bject. The bus driver uses it to represent the connection between the device and the bus.<br />
<br />
'''FDO''' stands for '''F'''unction '''D'''evice '''O'''bject. The function driver uses it to manage the functionality of the device.<br />
<br />
==Installing a PnP Device:==<br />
<br />
1.Bus driver detects the insertion or removal of hardware.<br />
<br />
2.Bus driver calls '''IoInvalidateDeviceRelations''' to notify PnP manager that the bus's population of child devices has changed.<br />
<br />
3.PnP manager sends '''IRP_MN_QUERY_DEVICE_RELATIONS''' to bus driver, to obtain an updated list of the PDOs for the child devices.<br />
<br />
4.PnP manager sends '''IRP_MN_QUERY_ID''' to bus driver, to obtain Device ID<br />
<br />
5.PnP manager locates INF install section and initialize driver. Memory Manager then calls DriverEntry routine.<br />
<br />
6.PnP manager calls AddDevice, to inform driver that a new instance of the device has been discovered<br />
<br />
7.PnP manager sends '''IRP_MN_QUERY_RESOURCE_REQUIREMENTS''' to bus driver, to ask bus driver report resource requirements.<br />
<br />
8.PnP manager configuire the hardware with as set of resource arbitrators to assign resources to the device.<br />
<br />
8.PnP manager sends '''IRP_MN_START_DEVICE''' to your driver (the driver stack). Function driver handles the IRP by configuring and connecting various kernel resources.<br />
<br />
<br />
===Order of AddDevice Calls (Driver Loading):===<br />
<br />
5. Class upper filters<br />
<br />
4. Device upper filters<br />
<br />
3. Function driver<br />
<br />
2. Class lower filters<br />
<br />
1. Device lower filters <br />
<br />
<br />
===IRP Routing:===<br />
System sends an IRP to the topmost filter dirver in the stack, that driver can decide to process the IRP, to pass the IRP down to the next level, or to do both. Each driver that sees the IRP makes the same decision.<br />
<br />
==See also==<br />
* [[How_PnP_Works_in_ReactOS]]<br />
* [[Umpnpmgr.exe]]<br />
<br />
[[Category:Kernel]]<br />
[[Category:Hardware]]</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna./How_the_system_Finds_and_Loads_Drivers&diff=34685User:Mna./How the system Finds and Loads Drivers2014-03-27T04:39:17Z<p>Mna.: Mna. moved page User:Mna./How the system Finds and Loads Drivers to How the system Finds and Loads Drivers: It's ready</p>
<hr />
<div>#REDIRECT [[How the system Finds and Loads Drivers]]</div>Mna.https://reactos.org/wiki/index.php?title=How_the_system_Finds_and_Loads_Drivers&diff=34683How the system Finds and Loads Drivers2014-03-27T04:37:59Z<p>Mna.: /* Driver types */</p>
<hr />
<div>=How the system Finds and Loads Drivers=<br />
<br />
original: http://blogs.msdn.com/b/xiz/archive/2013/11/04/how-the-system-finds-and-loads-drivers.aspx<br />
<br />
===Device types===<br />
'''1. PnP device'''<br />
<br />
It has an electronic signature that bus driver can detect the new hardware<br />
<br />
<br />
'''2. Legacy device'''<br />
<br />
Initiate the detection by invoking Add New Hardware Wizard.<br />
<br />
In the end, in both PnP and Legacy Device situation, system uses the same automatic registry and INF file process to load the right driver.<br />
<br />
===Driver types===<br />
'''Function driver:'''<br />
<br />
It understands the details about how to make the HW work.<br />
<br />
It's responsible for initiating IO operations, for handling interrupts, and for providing a way for end user to exercise control over the device.<br />
<br />
'''Bus driver:'''<br />
<br />
It's responsible for managing the connection between the Hardware and the computer.<br />
<br />
'''Filter Driver:'''<br />
<br />
is to Modify the behavior of an existing function driver in some way. Upper filter driver sees IRPs before function driver. Lower filter can modify the stream of bus operations that the function driver is trying to perform.<br />
<br />
'''PDO''' stands for '''P'''hysical '''D'''evice '''O'''bject. The bus driver uses it to represent the connection between the device and the bus.<br />
<br />
'''FDO''' stands for '''F'''unction '''D'''evice '''O'''bject. The function driver uses it to manage the functionality of the device.<br />
<br />
==Installing a PnP Device:==<br />
<br />
1.Bus driver detects the insertion or removal of hardware.<br />
<br />
2.Bus driver calls '''IoInvalidateDeviceRelations''' to notify PnP manager that the bus's population of child devices has changed.<br />
<br />
3.PnP manager sends '''IRP_MN_QUERY_DEVICE_RELATIONS''' to bus driver, to obtain an updated list of the PDOs for the child devices.<br />
<br />
4.PnP manager sends '''IRP_MN_QUERY_ID''' to bus driver, to obtain Device ID<br />
<br />
5.PnP manager locates INF install section and initialize driver. Memory Manager then calls DriverEntry routine.<br />
<br />
6.PnP manager calls AddDevice, to inform driver that a new instance of the device has been discovered<br />
<br />
7.PnP manager sends '''IRP_MN_QUERY_RESOURCE_REQUIREMENTS''' to bus driver, to ask bus driver report resource requirements.<br />
<br />
8.PnP manager configuire the hardware with as set of resource arbitrators to assign resources to the device.<br />
<br />
8.PnP manager sends '''IRP_MN_START_DEVICE''' to your driver (the driver stack). Function driver handles the IRP by configuring and connecting various kernel resources.<br />
<br />
<br />
===Order of AddDevice Calls (Driver Loading):===<br />
<br />
5. Class upper filters<br />
<br />
4. Device upper filters<br />
<br />
3. Function driver<br />
<br />
2. Class lower filters<br />
<br />
1. Device lower filters <br />
<br />
<br />
===IRP Routing:===<br />
System sends an IRP to the topmost filter dirver in the stack, that driver can decide to process the IRP, to pass the IRP down to the next level, or to do both. Each driver that sees the IRP makes the same decision.<br />
<br />
==See also==<br />
* [[How_PnP_Works_in_ReactOS]]<br />
* [[Umpnpmgr.exe]]<br />
<br />
[[Category:Kernel]]<br />
[[Category:Hardware]]</div>Mna.https://reactos.org/wiki/index.php?title=How_the_system_Finds_and_Loads_Drivers&diff=34682How the system Finds and Loads Drivers2014-03-27T04:35:45Z<p>Mna.: /* See also */</p>
<hr />
<div>=How the system Finds and Loads Drivers=<br />
<br />
original: http://blogs.msdn.com/b/xiz/archive/2013/11/04/how-the-system-finds-and-loads-drivers.aspx<br />
<br />
===Device types===<br />
'''1. PnP device'''<br />
<br />
It has an electronic signature that bus driver can detect the new hardware<br />
<br />
<br />
'''2. Legacy device'''<br />
<br />
Initiate the detection by invoking Add New Hardware Wizard.<br />
<br />
In the end, in both PnP and Legacy Device situation, system uses the same automatic registry and INF file process to load the right driver.<br />
<br />
===Driver types===<br />
'''Function driver:'''<br />
<br />
It understands the details about how to make the HW work.<br />
<br />
It's responsible for initiating IO operations, for handling interrupts, and for provding a way for end user to exersise control over the device.<br />
<br />
'''Bus driver:'''<br />
<br />
It's responsible for managing the connection between the HW and the computer.<br />
<br />
'''Filter Driver:'''<br />
<br />
is to Modify the behavior of an existing function driver in some way. Upper filter driver sees IRPs before function driver. Lower filter can modify the stream of bus operations that the function driver is trying to perform.<br />
<br />
'''PDO''' stands for physical device object. The bus driver uses it to represent the conncetion between the device and the bus.<br />
<br />
'''FDO''' stands for function devive object. The function driver uses it to manage the functionality of the device.<br />
<br />
==Installing a PnP Device:==<br />
<br />
1.Bus driver detects the insertion or removal of hardware.<br />
<br />
2.Bus driver calls '''IoInvalidateDeviceRelations''' to notify PnP manager that the bus's population of child devices has changed.<br />
<br />
3.PnP manager sends '''IRP_MN_QUERY_DEVICE_RELATIONS''' to bus driver, to obtain an updated list of the PDOs for the child devices.<br />
<br />
4.PnP manager sends '''IRP_MN_QUERY_ID''' to bus driver, to obtain Device ID<br />
<br />
5.PnP manager locates INF install section and initialize driver. Memory Manager then calls DriverEntry routine.<br />
<br />
6.PnP manager calls AddDevice, to inform driver that a new instance of the device has been discovered<br />
<br />
7.PnP manager sends '''IRP_MN_QUERY_RESOURCE_REQUIREMENTS''' to bus driver, to ask bus driver report resource requirements.<br />
<br />
8.PnP manager configuire the hardware with as set of resource arbitrators to assign resources to the device.<br />
<br />
8.PnP manager sends '''IRP_MN_START_DEVICE''' to your driver (the driver stack). Function driver handles the IRP by configuring and connecting various kernel resources.<br />
<br />
<br />
===Order of AddDevice Calls (Driver Loading):===<br />
<br />
5. Class upper filters<br />
<br />
4. Device upper filters<br />
<br />
3. Function driver<br />
<br />
2. Class lower filters<br />
<br />
1. Device lower filters <br />
<br />
<br />
===IRP Routing:===<br />
System sends an IRP to the topmost filter dirver in the stack, that driver can decide to process the IRP, to pass the IRP down to the next level, or to do both. Each driver that sees the IRP makes the same decision.<br />
<br />
==See also==<br />
* [[How_PnP_Works_in_ReactOS]]<br />
* [[Umpnpmgr.exe]]<br />
<br />
[[Category:Kernel]]<br />
[[Category:Hardware]]</div>Mna.https://reactos.org/wiki/index.php?title=How_the_system_Finds_and_Loads_Drivers&diff=34681How the system Finds and Loads Drivers2014-03-27T04:34:10Z<p>Mna.: /* Installing a PnP Device: */</p>
<hr />
<div>=How the system Finds and Loads Drivers=<br />
<br />
original: http://blogs.msdn.com/b/xiz/archive/2013/11/04/how-the-system-finds-and-loads-drivers.aspx<br />
<br />
===Device types===<br />
'''1. PnP device'''<br />
<br />
It has an electronic signature that bus driver can detect the new hardware<br />
<br />
<br />
'''2. Legacy device'''<br />
<br />
Initiate the detection by invoking Add New Hardware Wizard.<br />
<br />
In the end, in both PnP and Legacy Device situation, system uses the same automatic registry and INF file process to load the right driver.<br />
<br />
===Driver types===<br />
'''Function driver:'''<br />
<br />
It understands the details about how to make the HW work.<br />
<br />
It's responsible for initiating IO operations, for handling interrupts, and for provding a way for end user to exersise control over the device.<br />
<br />
'''Bus driver:'''<br />
<br />
It's responsible for managing the connection between the HW and the computer.<br />
<br />
'''Filter Driver:'''<br />
<br />
is to Modify the behavior of an existing function driver in some way. Upper filter driver sees IRPs before function driver. Lower filter can modify the stream of bus operations that the function driver is trying to perform.<br />
<br />
'''PDO''' stands for physical device object. The bus driver uses it to represent the conncetion between the device and the bus.<br />
<br />
'''FDO''' stands for function devive object. The function driver uses it to manage the functionality of the device.<br />
<br />
==Installing a PnP Device:==<br />
<br />
1.Bus driver detects the insertion or removal of hardware.<br />
<br />
2.Bus driver calls '''IoInvalidateDeviceRelations''' to notify PnP manager that the bus's population of child devices has changed.<br />
<br />
3.PnP manager sends '''IRP_MN_QUERY_DEVICE_RELATIONS''' to bus driver, to obtain an updated list of the PDOs for the child devices.<br />
<br />
4.PnP manager sends '''IRP_MN_QUERY_ID''' to bus driver, to obtain Device ID<br />
<br />
5.PnP manager locates INF install section and initialize driver. Memory Manager then calls DriverEntry routine.<br />
<br />
6.PnP manager calls AddDevice, to inform driver that a new instance of the device has been discovered<br />
<br />
7.PnP manager sends '''IRP_MN_QUERY_RESOURCE_REQUIREMENTS''' to bus driver, to ask bus driver report resource requirements.<br />
<br />
8.PnP manager configuire the hardware with as set of resource arbitrators to assign resources to the device.<br />
<br />
8.PnP manager sends '''IRP_MN_START_DEVICE''' to your driver (the driver stack). Function driver handles the IRP by configuring and connecting various kernel resources.<br />
<br />
<br />
===Order of AddDevice Calls (Driver Loading):===<br />
<br />
5. Class upper filters<br />
<br />
4. Device upper filters<br />
<br />
3. Function driver<br />
<br />
2. Class lower filters<br />
<br />
1. Device lower filters <br />
<br />
<br />
===IRP Routing:===<br />
System sends an IRP to the topmost filter dirver in the stack, that driver can decide to process the IRP, to pass the IRP down to the next level, or to do both. Each driver that sees the IRP makes the same decision.<br />
<br />
==See also==<br />
* [[How_PnP_Works_in_ReactOS]]<br />
* [[Umpnpmgr.exe]]</div>Mna.https://reactos.org/wiki/index.php?title=How_the_system_Finds_and_Loads_Drivers&diff=34680How the system Finds and Loads Drivers2014-03-26T17:18:24Z<p>Mna.: /* How the system Finds and Loads Drivers */</p>
<hr />
<div>=How the system Finds and Loads Drivers=<br />
<br />
original: http://blogs.msdn.com/b/xiz/archive/2013/11/04/how-the-system-finds-and-loads-drivers.aspx<br />
<br />
===Device types===<br />
'''1. PnP device'''<br />
<br />
It has an electronic signature that bus driver can detect the new hardware<br />
<br />
<br />
'''2. Legacy device'''<br />
<br />
Initiate the detection by invoking Add New Hardware Wizard.<br />
<br />
In the end, in both PnP and Legacy Device situation, system uses the same automatic registry and INF file process to load the right driver.<br />
<br />
===Driver types===<br />
'''Function driver:'''<br />
<br />
It understands the details about how to make the HW work.<br />
<br />
It's responsible for initiating IO operations, for handling interrupts, and for provding a way for end user to exersise control over the device.<br />
<br />
'''Bus driver:'''<br />
<br />
It's responsible for managing the connection between the HW and the computer.<br />
<br />
'''Filter Driver:'''<br />
<br />
is to Modify the behavior of an existing function driver in some way. Upper filter driver sees IRPs before function driver. Lower filter can modify the stream of bus operations that the function driver is trying to perform.<br />
<br />
'''PDO''' stands for physical device object. The bus driver uses it to represent the conncetion between the device and the bus.<br />
<br />
'''FDO''' stands for function devive object. The function driver uses it to manage the functionality of the device.<br />
<br />
==Installing a PnP Device:==<br />
<br />
1.Bus driver detects the insertion or removal of hardware.<br />
<br />
2.Bus driver calls '''IoInvalidateDeviceRelations''' to notify PnP manager that the bus's population of child devices has changed.<br />
<br />
3.PnP manager sends '''IRP_MN_QUERY_DEVICE_RELATIONS''' to bus driver, to obtain an updated list of the PDOs for the child devices.<br />
<br />
4.PnP manager sends '''IRP_MN_QUERY_ID''' to bus driver, to obtain Device ID<br />
<br />
5.PnP manager locates INF install section and initialize driver. Memory Manager then calls DriverEntry routine.<br />
<br />
6.PnP manager calls AddDevice, to inform driver that a new instance of the device has been discovered<br />
<br />
7.PnP manager sends '''IRP_MN_QUERY_RESOURCE_REQUIREMENTS''' to bus driver, to ask bus driver report resource requirements.<br />
<br />
8.PnP manager configuire the hardware with as set of resource arbitrators to assign resources to the device.<br />
<br />
8.PnP manager sends '''IRP_MN_START_DEVICE''' to your driver (the driver stack). Function driver handles the IRP by configuring and connecting various kernel resources.<br />
<br />
<br />
===Order of AddDevice Calls (Driver Loading):===<br />
<br />
5. Class upper filters<br />
<br />
4. Device upper filters<br />
<br />
3. Function driver<br />
<br />
2. Class lower filters<br />
<br />
1. Device lower filters <br />
<br />
<br />
===IRP Routing:===<br />
System sends an IRP to the topmost filter dirver in the stack, that driver can decide to process the IRP, to pass the IRP down to the next level, or to do both. Each driver that sees the IRP makes the same decision.</div>Mna.https://reactos.org/wiki/index.php?title=How_the_system_Finds_and_Loads_Drivers&diff=34679How the system Finds and Loads Drivers2014-03-26T17:15:44Z<p>Mna.: /* How the system Finds and Loads Drivers */</p>
<hr />
<div>=How the system Finds and Loads Drivers=<br />
<br />
original: http://blogs.msdn.com/b/xiz/archive/2013/11/04/how-the-system-finds-and-loads-drivers.aspx<br />
<br />
===1. PnP device===<br />
It has an electronic signature that bus driver can detect the new hardware<br />
<br />
===2. Legacy device===<br />
Initiate the detection by invoking Add New Hardware Wizard.<br />
<br />
In the end, in both PnP and Legacy Device situation, system uses the same automatic registry and INF file process to load the right driver.<br />
<br />
'''Function driver:'''<br />
<br />
It understands the details about how to make the HW work.<br />
<br />
It's responsible for initiating IO operations, for handling interrupts, and for provding a way for end user to exersise control over the device.<br />
<br />
'''Bus driver:'''<br />
<br />
It's responsible for managing the connection between the HW and the computer.<br />
<br />
'''Filter Driver:'''<br />
<br />
is to Modify the behavior of an existing function driver in some way. Upper filter driver sees IRPs before function driver. Lower filter can modify the stream of bus operations that the function driver is trying to perform.<br />
'''PDO''' stands for physical device object. The bus driver uses it to represent the conncetion between the device and the bus.<br />
<br />
'''FDO''' stands for function devive object. The function driver uses it to manage the functionality of the device.<br />
==Installing a PnP Device:==<br />
<br />
1.Bus driver detects the insertion or removal of hardware.<br />
<br />
2.Bus driver calls '''IoInvalidateDeviceRelations''' to notify PnP manager that the bus's population of child devices has changed.<br />
<br />
3.PnP manager sends '''IRP_MN_QUERY_DEVICE_RELATIONS''' to bus driver, to obtain an updated list of the PDOs for the child devices.<br />
<br />
4.PnP manager sends '''IRP_MN_QUERY_ID''' to bus driver, to obtain Device ID<br />
<br />
5.PnP manager locates INF install section and initialize driver. Memory Manager then calls DriverEntry routine.<br />
<br />
6.PnP manager calls AddDevice, to inform driver that a new instance of the device has been discovered<br />
<br />
7.PnP manager sends '''IRP_MN_QUERY_RESOURCE_REQUIREMENTS''' to bus driver, to ask bus driver report resource requirements.<br />
<br />
8.PnP manager configuire the hardware with as set of resource arbitrators to assign resources to the device.<br />
<br />
8.PnP manager sends '''IRP_MN_START_DEVICE''' to your driver (the driver stack). Function driver handles the IRP by configuring and connecting various kernel resources.<br />
<br />
<br />
===Order of AddDevice Calls (Driver Loading):===<br />
<br />
5. Class upper filters<br />
<br />
4. Device upper filters<br />
<br />
3. Function driver<br />
<br />
2. Class lower filters<br />
<br />
1. Device lower filters <br />
<br />
<br />
===IRP Routing: ===<br />
System sends an IRP to the topmost filter dirver in the stack, that driver can decide to process the IRP, to pass the IRP down to the next level, or to do both. Each driver that sees the IRP makes the same decision.</div>Mna.https://reactos.org/wiki/index.php?title=How_the_system_Finds_and_Loads_Drivers&diff=34678How the system Finds and Loads Drivers2014-03-26T17:06:19Z<p>Mna.: </p>
<hr />
<div>=How the system Finds and Loads Drivers=<br />
<br />
original: http://blogs.msdn.com/b/xiz/archive/2013/11/04/how-the-system-finds-and-loads-drivers.aspx<br />
<br />
===1. PnP device===<br />
<br />
It has an electronic signature that bus driver can detect the new hardware<br />
<br />
===2. Legacy device===<br />
<br />
Initiate the detection by invoking Add New Hardware Wizard.<br />
<br />
<br />
In the end, in both PnP and Legacy Device situation, system uses the same automatic registry and INF file process to load the right driver.<br />
<br />
<br />
<br />
===Function driver:===<br />
<br />
It understands the details about how to make the HW work.<br />
<br />
It's responsible for initiating IO operations, for handling interrupts, and for provding a way for end user to exersise control over the device.<br />
<br />
<br />
<br />
===Bus driver:===<br />
<br />
It's responsible for managing the connection between the HW and the computer.<br />
<br />
<br />
<br />
===Filter Driver:===<br />
<br />
to Modify the behavior of an existing function driver in some way. Upper filter driver sees IRPs before function driver. Lower filter can modify the stream of bus operations that the function driver is trying to perform.<br />
<br />
<br />
<br />
'''PDO''' stands for physical device object. The bus driver uses it to represent the conncetion between the device and the bus.<br />
<br />
'''FDO''' stands for function devive object. The function driver uses it to manage the functionality of the device.<br />
<br />
<br />
<br />
==Installing a PnP Device:==<br />
<br />
1.Bus driver detects the insertion or removal of hardware.<br />
<br />
2.Bus driver calls '''IoInvalidateDeviceRelations''' to notify PnP manager that the bus's population of child devices has changed.<br />
<br />
3.PnP manager sends '''IRP_MN_QUERY_DEVICE_RELATIONS''' to bus driver, to obtain an updated list of the PDOs for the child devices.<br />
<br />
4.PnP manager sends '''IRP_MN_QUERY_ID''' to bus driver, to obtain Device ID<br />
<br />
5.PnP manager locates INF install section and initialize driver. Memory Manager then calls DriverEntry routine.<br />
<br />
6.PnP manager calls AddDevice, to inform driver that a new instance of the device hs been discovered<br />
<br />
7.PnP manager sends '''IRP_MN_QUERY_RESOURCE_REQUIREMENTS''' to bus driver, to ask bus driver report resource requirements.<br />
<br />
8.PnP manager configuire the hardware with as set of resource arbitrators to assign resources to the device.<br />
<br />
8.PnP manager sends '''IRP_MN_START_DEVICE''' to your driver(the driver stack). Function driver handles thei IRP by configuring and connecting various kernel resources.<br />
<br />
<br />
===Order of AddDevice Calls (Driver Loading):===<br />
<br />
5. Class upper filters<br />
<br />
4. Device upper filters<br />
<br />
3. function driver<br />
<br />
2. Class lower filters<br />
<br />
1. Device lower filters <br />
<br />
<br />
===IRP Routing: ===<br />
System sends an IRP to the topmost filter dirver in the stack, that driver can decide to process the IRP, to pass the IRP down to the next level, or to do both. Each driver that sees the IRP makes the same decision.</div>Mna.https://reactos.org/wiki/index.php?title=How_the_system_Finds_and_Loads_Drivers&diff=34677How the system Finds and Loads Drivers2014-03-26T17:03:47Z<p>Mna.: Created page with "=How the system Finds and Loads Drivers =original: http://blogs.msdn.com/b/xiz/archive/2013/11/04/how-the-system-finds-and-loads-drivers.aspx 1. PnP device It has an electron..."</p>
<hr />
<div>=How the system Finds and Loads Drivers =original: http://blogs.msdn.com/b/xiz/archive/2013/11/04/how-the-system-finds-and-loads-drivers.aspx<br />
1. PnP device<br />
<br />
It has an electronic signature that bus driver can detect the new hardware<br />
<br />
2. Legacy device<br />
<br />
Initiate the detection by invoking Add New Hardware Wizard.<br />
<br />
<br />
In the end, in both PnP and Legacy Device situation, system uses the same automatic registry and INF file process to load the right driver.<br />
<br />
<br />
<br />
Function driver:<br />
<br />
It understands the details about how to make the HW work.<br />
<br />
It's responsible for initiating IO operations, for handling interrupts, and for provding a way for end user to exersise control over the device.<br />
<br />
<br />
<br />
Bus driver:<br />
<br />
It's responsible for managing the connection between the HW and the computer.<br />
<br />
<br />
<br />
Filter Driver:<br />
<br />
to Modify the behavior of an existing function driver in some way.Upper filter driver sees IRPs before function driver. Lower filter can modify the stream of bus operations that the function driver is trying to perform.<br />
<br />
<br />
<br />
PDO stands for physical device object. The bus driver uses it to represent the conncetion between the device and the bus.<br />
<br />
FDO stands for function devive object. The function driver uses it to manage the functionality of the device.<br />
<br />
<br />
<br />
Installing a PnP Device:<br />
<br />
1.Bus driver detects the insertion or removal of hardware.<br />
<br />
2.Bus driver calls IoInvalidateDeviceRelations to notify PnP manager that the bus's population of child devices has changed.<br />
<br />
3.PnP manager sends IRP_MN_QUERY_DEVICE_RELATIONS to bus driver, to obtain an updated list of the PDOs for the child devices.<br />
<br />
4.PnP manager sends IRP_MN_QUERY_ID to bus driver, to obtain Device ID<br />
<br />
5.PnP manager locates INF install section and initialize driver. Memory Manager then calls DriverEntry routine.<br />
<br />
6.PnP manager calls AddDevice, to inform driver that a new instance of the device hs been discovered<br />
<br />
7.PnP manager sends IRP_MN_QUERY_RESOURCE_REQUIREMENTS to bus driver, to ask bus driver report resource requirements.<br />
<br />
8.PnP manager configuire the hardware with as set of resource arbitrators to assign resources to the device.<br />
<br />
8.PnP manager sends IRP_MN_START_DEVICE to your driver(the driver stack). Function driver handles thei IRP by configuring and connecting various kernel resources.<br />
<br />
<br />
Order of AddDevice Calls (Driver Loading):<br />
<br />
5. Class upper filters<br />
<br />
4. Device upper filters<br />
<br />
3. function driver<br />
<br />
2. Class lower filters<br />
<br />
1. Device lower filters <br />
<br />
<br />
IRP Routing: <br />
System sends an IRP to the topmost filter dirver in the stack, that driver can decide to process the IRP, to pass the IRP down to the next level, or to do both. Each driver that sees the IRP makes the same decision.</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna.&diff=34676User:Mna.2014-03-26T16:58:06Z<p>Mna.: /* (Generic) Development */</p>
<hr />
<div>My patches to ReactOS// My Bookmarks with useful info// Future place for Manifest-like texts.<br />
<br />
==My Patches/WIP==<br />
''(WIP = Work in Progress)''<br />
* [Done] dmesg/kmesg command in ReactOS native kernel debugger [https://jira.reactos.org/browse/CORE-5452 CORE-5452], described there.<br />
** --<br />
* [Done/not-included] dmesg.exe User-mode utility: done. but not applied (.rbuild system was broken/removed then at the moment + 3 month delay of community considering accepting my kmesg patch).<br />
* WIP (Important thing): MMIO for serial card at kernel early-boot. -- MMIO serial cards doesn't work at all in ROS.<br />
* [Done] micropatch: print CPUs count and available RAM at ROS start (work related with low-memory related bug)<br />
* (..describe later..: partitions' bug, FAT32-moved-root-node, etc)<br />
* usetup.c - series: [http://jira.reactos.org/browse/CORE-7969 CORE-7969] submitted patch at 08.03.2014: will see how long it will stay not applied. (+1week later)<br />
<br />
==Issues: Reported and not yet==<br />
* [http://jira.reactos.org/browse/CORE-7978 CORE-7978] - ReactOS boot code of MBR can't boot USB-HDD due to error reading sectors with int13h_ah=42h<br />
** Added there link to very good explanation how does GRUB stage1 loader work! Just an amazingly detailed description (and also even with joke in stage2!) [http://thestarman.pcministry.com/asm/mbr/GRUB.htm This] link.<br />
** Workaround: use grub-2 to load freeldr.sys<br />
** freeldr.ini also requires editing the rdisk() parameter addressing the disks:<br />
SystemPath=multi(0)disk(0)rdisk(1)partition(2)\ReactOS<br />
<br />
rdisk(1)partition(2) here means: 2nd disk, 2nd partition. (partitions are 1-counted, rdisks - 0-counted.)<br />
<br />
* [Yet old bug of 2010/11 times until now] (On my machine: AcerAspire5920g) ReactOS loading process stuck on line ...\Drivers\DISK.SYS when Disk operation mode in BIOS is set to AHCI. Changed the mode to IDE "workarounds" the problem: ntoskrnl.exe reaches the last line ...\Drivers\NDIS.SYS -- and is stuck somewhere more later -- eating 100% CPU. (//Debug-log is required)<br />
So the summary: SATA2 is not fully supported by ReactOS, forced to use IDE.<br />
<br />
==MyBookmarks==<br />
Interesting topics, links (Started at 2011-04-03)<br />
<br />
Here I will keep links to forum topics, wiki pages or other, that seemed to be interesting:<br />
<br />
====(Generic) Development====<br />
* [http://jira.reactos.org/issues/?filter=-4 All issues of ReactOS] [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20ORDER%20BY%20createdDate%20DESC bugs only]<br />
* [[Missing ReactOS Functionality]] - major things absent of ROS from User PoV<br />
* [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20ORDER%20BY%20priority%20DESC%2C%20createdDate%20DESC Sorted by importance (''priority'' now in JIRA) bugs of ReactOS], excepto of resolved ones<br />
<br />
* [http://www.reactos.org/wiki/How_PnP_Works_in_ReactOS How PnP Works in ReactOS]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8459 ReactOS, how much money it requires?] - here is only the idea, to be converted to become more correct: "How many man-months?", given man-month is more like a myth, reconsider on per-project basis<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8126 HOWTO Become a Reactos Programmer?] - forum topic, could be converted to more constructive instruction<br />
* [http://dslab.epfl.ch/proj/reveng RevEng: Device Driver Reverse Engineering] from [http://www.reactos.org/forum/viewtopic.php?f=9&t=7990 here]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8206 Command-line-only Win32 from ReactOS?] The topic about full OS without GUI ("headless"?).<br />
** Resembles me idea of [http://hex.pp.ua/nt-native-applications-shell-eng.php Windows/ReactOS Native Shell]) ([http://www.reactos.org/forum/viewtopic.php?f=11&t=9092 Russian]).<br />
* [[Modify the final ISO image]] - good article, have also notes on how (bootcd) final CD-image is composed<br />
* [http://iso.reactos.org/bootcd/ bootcd repository] iso.reactos.org bootcd images<br />
* [http://iso.reactos.org/livecd/ livecd repository]<br />
<br />
* [[FreeLoader]], details, [[User:Mna./FreeLoader,_bootcd_and_bootrecords#FreeLoader_freeldr_Architecture|freeldr Architecture]] and related startup steps: [[User:Mna./FreeLoader,_bootcd_and_bootrecords|bootcd and bootrecords]]<br />
* [http://en.wikipedia.org/wiki/Windows_NT_Startup_Process Windows NT Startup Process/ Sequence]<br />
* [[User:Mna./How the system Finds and Loads Drivers|How the system Finds and Loads Drivers]]<br />
* ROS build system hands-on:<br />
** [[Building_Modules#List_available_ninja_targets|available ninja targets]]<br />
** [[Building_Modules#Removing_or_Updating_a_Module|Updating a module code]] -- do this when the ROS module code was changed and build system didn't notice<br />
** Strange thing become clear; Ctrl+D doesn't work in 1st stage setup.<br />
BootOptions=DbgOsLoadOptions = "/NOGUIBOOT /DEBUGPORT=COM:io,0x3f8,115200n8 /DEBUGPORT=SCREEN" See also [[User:Mna./FreeLoader_freeldr_Architecture#Specifing_Boot_Options|Specifing Boot kernel Options]]<br />
* [irc://irc.freenode.net/reactos #reactos] - For general discussion and user support, most people are here<br />
<br />
====Filesystems generic====<br />
* [[File Systems]], a good page<br />
<br />
====Editing ReactOS registry offline====<br />
From [http://www.reactos.org/forum/viewtopic.php?t=3162 here]<br />
{| class="wikitable"<br />
|-<br />
| <br />
Editing ReactOS registry hives outside ReactOS?<br />
--2006-12<br />
<br />
> Is it possible at this moment to edit the registry hives outside the ReactOS environment?<br />
> I wanted to automate a process to load these registry hives onto the local registry, <br />
> add all my changes, unload the hives and create a new ISO.<br />
<br />
Simply change registry sources and build your own binary hives from them.<br />
<br />
by hto <br/><br />
<br />
> I guess "make" is the prefered way, there isn't any other method for creating these hives?<br /><br />
<br />
There is hive maker in tools\mkhive. You can build it with mingw32-make.exe mkhive<br />
<br />
Copy it from output-i386\tools\mkhive\mkhive.exe to (say) Windows\mkhive.exe.<br />
Then run this command:<br />
<br />
mkhive.exe boot\bootdata output-i386\livecd\reactos\system32\config boot\bootdata\livecd.inf boot\bootdata\hiveinst.inf<br />
<br />
Where output-i386\livecd\reactos\system32\config -- is output folder for hives.<br />
This is how ''make livecd'' does it.<br />
And yes, you can add your foo.inf to the end of that command.<br />
|}<br />
<br />
====NTFS====<br />
* post about [http://www.reactos.org/forum/viewtopic.php?f=9&t=8180#p71875 FUSE-lib creation attempts in ROS] in the "[http://www.reactos.org/forum/viewtopic.php?f=9&t=8180 NTFS question]" topic<br />
* (ru) [http://www.reactos.org/forum/viewtopic.php?f=11&t=8606 NTFS-3G applied to ROS], with ''unixed'' 's idea how to integrate into the '''fuse4win''' or '''dokan'''<br />
<br />
====Misc====<br />
* [http://alter.org.ua/soft/win/uni_ata/ UniATA] project link, Current version is 0.40b2, Updated @2011.03.24. ROS wasn't sinced with it since version-'?.?'...<br />
* [http://alter.org.ua/en/soft/win/vidcontrol/ Display Control for Windows], Alter's site; Now part of [http://alter.org.ua/en/soft/win/uictl/ UI ctl]<br />
<br />
===Serial extension card and MMIO programming===<br />
* [https://android.googlesource.com/kernel/omap/+/glass-omap-xrr02/drivers/tty/serial/8250_early.c android kernel driver tty-serial 8250_early.c] : as serial debug interface, Android can specify not only IO-ports, but also MMIO and MMIO32 addresses. The "shentek" serial card which I own, requires such communication method, it is based on Oxford chip and gives only mmio interface.<br />
* MMIO [http://en.wikipedia.org/wiki/Memory-mapped_I/O MMIO = Memory-mapped_I/O] Linux:[http://nouveau.freedesktop.org/wiki/MmioTrace/ MmioTrace Home] [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/trace/mmiotrace.txt mmiotrace doc]<br />
<br />
**'''Note: I have much info/hands-on to add here...'''<br />
<br />
===Debug prints in ROS===<br />
* [http://alter.org.ua/docs/nt_kernel/kdprint/ KdPrint/DbgPrint and OutputDebugString behavior] at Alter's site,<br />
* [http://www.codeproject.com/KB/winsdk/OutputDebugString.aspx?display=Print Mechanism of OutputDebugString - CodeProject] the ready code sample,<br />
They (articles) discuss internals and mechanism of OutputDebugString. Definitely Windows too (as unices) uses system calls to store and receive debug messages data to/from kernel debug messages buffer.<br />
<br />
** [http://www.reactos.org/wiki/Enable_kernel_tracing ROS: Enable kernel tracing]<br />
<br />
<br />
====Unix dmesg Internals Analysis====<br />
''for comparison and for creating something equivalent/analogous in ROS''<br />
Shortly:<br />
*'''Linux''' has special system call "'''syslog'''" (man 2 syslog)<br />
*'''FreeBSD''' uses its special '''sysctl''' interface to kernel along with "'''kern.msgbuf'''" parameter.<br />
<br />
'''D'''o we need special system call like Linux, or even more, the whole<br />
family of them (sysctl('*')) as in BSD?<br />
How to implement simple system call for it, now?<br />
<br />
---<br />
<br />
Detailed info for unices:<br />
<br />
'''Linux case''':<br />
* syslog(2) - read and/or clear kernel message ring buffer; set console_loglevel<br />
int syslog(int type, char *bufp, int len);<br />
* also /proc/kmsg virtual file, which when being read returns buffer contents<br />
<br />
Excerpt from "man proc":<br />
<pre><br />
/proc/kmsg<br />
This file can be used instead of the syslog(2) system<br />
call to read kernel messages. A<br />
process must have superuser privileges to read this<br />
file, and only one process should read<br />
this file. This file should not be read if a syslog<br />
process is running which uses the sys‐<br />
log(2) system call facility to log kernel messages.<br />
<br />
Information in this file is retrieved with the dmesg(1) program.<br />
</pre><br />
<br />
'''dmesg in FreeBSD''':<br />
*Parameter 'kern.msgbuf' given to sysctl(3) returns contents of kernel message buffer.<br />
*There is also 'kern.msgbuf_clear' to clean the buffer.<br />
<br />
<br />
====/*USB====<br />
These could be probably outdated in sense the USB now is in better working state.<br />
* [http://wiki.osdev.org/Main osdev.org wiki] - main page, [http://wiki.osdev.org/USB USB, the same place]<br />
* USB for NT4:<br />
** Alter's site reviews: [http://alter.org.ua/en/docs/win/nt4_usb/ en], [http://alter.org.ua/ru/docs/win/nt4_usb/ ru]<br />
** Woodheads opensource(!), GPL USB driver: [ftp://piekraste.daba.lv/pub/Service_Pack/NT_4/NT4_USB/HS/ files backed up] [http://www.geocities.com/mypublic99/index.html "Woodhead--NT4--USB" original link (dead)]<br />
** [http://nt4ref.zcm.com.au/usb.htm Windows NT 4.0 and USB] Quote: "Conclusion: I wish people would stop making comments like 'USB is not supported under NT4' - If you must comment please make it accurate, example: 'Microsoft have made the commercial decision not to provide NT4 USB support - but some manufacturers provide support for specific USB devices on NT4.'"<br />
<br />
====*/====<br />
<br />
<br />
=== FreeLoader, debug information, getting===<br />
Related with low-memory bug: 1) 4Gb was recognized as 25Mb 2) ROS started with 25Mb silently eat up 100% CPU and infinitely read from boot CD/HDD.<br />
* Debugging the FreeLdr: [http://jira.reactos.org/secure/attachment/16335/freeldr.patch freeldr.patch turning on debug mode] from [http://jira.reactos.org/browse/CORE-5462 CORE-5462] -- patch by ''rafalh''<br />
* [[FreeLoader]]<br />
<br />
Misc...<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=7915#p68991 by gabrielilardi @ 20 Jan 2010, forum of ROS]<br />
* [http://www.reactos.org/forum/viewtopic.php?p=62488#p62488 by hto @13 Jul 2009]<br />
<br />
===SVN how-to links===<br />
* [http://subversion.apache.org/faq.html] found through google [svn through proxy]<br />
* [http://www.mikepot.com/1544.html], same<br />
* SVN book: [http://svn.zen-cart.org.ua/documentation/en/book/svn-book.html Version Control with Subversion 1.2]<br />
** [http://svn.zen-cart.org.ua/documentation/ru/book/ Same SVN guide, russian]</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna./FreeLoader,_bootcd_and_bootrecords&diff=34675User:Mna./FreeLoader, bootcd and bootrecords2014-03-26T10:06:52Z<p>Mna.: /* ntoskrnl.exe loading and start */</p>
<hr />
<div>=FreeLoader freeldr Architecture=<br />
<br />
==FreeLoader Initialization==<br />
When FreeLoader gets control it <br />
* saves the boot drive, passed to it in the DL register, partition number passed in the DH register<br />
* sets up the stack, <br />
* enables protected mode, and <br />
* calls BootMain().<br />
--based on quote from \boot\freeldr\notes.txt<br />
<br />
==Freeloader calls hierarchy==<br />
===BootMain===<br />
VOID BootMain(LPSTR CmdLine) is layed in \boot\freeldr\freeldr\freeldr.c<br />
<br />
It is main Freeldr function:<br />
<br />
<pre><br />
VOID BootMain(LPSTR CmdLine)<br />
{<br />
CmdLineParse(CmdLine);<br />
MachInit(CmdLine);<br />
FsInit();<br />
DebugInit();<br />
TRACE("BootMain() called.\n");<br />
<br />
if (!UiInitialize(FALSE))<br />
{<br />
UiMessageBoxCritical("Unable to initialize UI.\n");<br />
goto quit;<br />
}<br />
if (!MmInitializeMemoryManager())<br />
{<br />
UiMessageBoxCritical("Unable to initialize memory manager");<br />
goto quit;<br />
}<br />
#ifdef _M_IX86<br />
HalpInitializePciStubs();<br />
HalpInitBusHandler();<br />
#endif<br />
RunLoader();<br />
<br />
quit:<br />
/* If we reach this point, something went wrong before, therefore reboot */<br />
DiskStopFloppyMotor();<br />
Reboot();<br />
}<br />
</pre><br />
<br />
\boot\freeldr\freeldr\debug.c : DebugInit()<br />
Initializes Rs232 port, among other things.<br />
<br />
===OS_LOADING_METHOD===<br />
'''BootMain'''() calls '''RunLoader'''() //''bootmgr.c''<br />
<br />
'''RunLoader'''() calls '''LoadOperatingSystem'''()<br />
<br />
'''LoadOperatingSystem'''() lookups the OS_LOADING_METHOD and calls found ''loading method''.<br />
<br />
//VOID LoadOperatingSystem(IN OperatingSystemItem* OperatingSystem); //''@\boot\freeldr\freeldr\bootmgr.c''<br />
<br />
OS_LOADING_METHOD is a function pointer field in the table of OSLoadingMethods (in bootmgr.c) :<br />
<pre><br />
typedef VOID (*OS_LOADING_METHOD)(IN OperatingSystemItem* OperatingSystem,<br />
IN USHORT OperatingSystemVersion);<br />
</pre><br />
Most used ''loading methods'' are: LoadAndBootWindows(), LoadReactOSSetup() (@''\boot\freeldr\freeldr\windows\ {winldr.c,setupldr.c}'' )<br />
<br />
* Windows2003/'''LoadAndBootWindows'''() is a normal/default loading method, called by installed ReactOS.<br />
* ReactOSSetup/'''LoadReactOSSetup'''() is a method called by ReactOS bootcd installer ''usetup.exe''.<br />
<br />
List of all ReactOS loading methods:<br />
<pre><br />
{"ReactOSSetup", 0 , LoadReactOSSetup },<br />
#ifdef _M_IX86<br />
{"BootSector" , 0 , LoadAndBootBootSector},<br />
{"Drive" , 0 , LoadAndBootDrive },<br />
{"Partition" , 0 , LoadAndBootPartition },<br />
<br />
{"Linux" , 0 , LoadAndBootLinux },<br />
<br />
{"Windows" , 0 , LoadAndBootWindows },<br />
{"WindowsNT40" , _WIN32_WINNT_NT4 , LoadAndBootWindows },<br />
#endif<br />
{"Windows2003" , _WIN32_WINNT_WS03, LoadAndBootWindows },<br />
</pre><br />
<br />
=== DoOptionsMenu() ===<br />
Options menu is activated by pressing F8 key.<br />
<br />
RunLoader() checks keys and activates; calls DoOptionsMenu() (options.c)<br />
<br />
=Boot records and FreeLoader=<br />
freeldr.sys is started by some type of BootRecord (BR): MBR, VBR, CD boot sector.<br />
<br />
==How bootcd installer usetup.exe writes MBR==<br />
When installing the ReactOS some component should write MBR/VBR to let freeldr.sys start at boot time.<br />
<br />
This is done by usetup.exe : <br />
* BootLoaderHarddiskMbrPage(&Ir) and its helpers: <br />
** InstallMbrBootCodeToDisk()/2 and <br />
** InstallVBRToPartition()/4.<br />
*** InstallFatBootcodeToPartition()/4<br />
<br />
<pre><br />
/** Side note related with bug in usetup.exe -bug writing MBR/VBR in some (frequent) cases: */<br />
<br />
MBRInstallType: usetup.exe variable keeps Boot Record installation mode:<br />
0-None (skip installation) 1-floppy MBR 2-Hdd MBR & VBR <br />
Files:<br />
/base/setup/reactos/ reactos.c : struct SetupData has field MBRInstallType<br />
/base/setup/usetup/interface/ usetup.c : use of MBRInstallType data.<br />
</pre><br />
<br />
'''usetup.exe''' : Page '''''BOOT_LOADER_HARDDISK_MBR_PAGE''''' is handled by: BootLoaderHarddiskMbrPage(&Ir);<br />
( @/base/setup/usetup/interface/usetup.c)<br />
<br />
'''BootLoaderHarddiskMbrPage''' function creates/writes MBR and VBR records.<br />
<br />
''/*** So the main errors are here: This function somehow is not called or the call/subcalls are failed. */''<br />
<br />
<pre><br />
BootLoaderHarddiskMbrPage(&Ir);<br />
/* Step 1: Write the VBR */<br />
InstallVBRToPartition()/4<br />
if (!NT_SUCCESS(Status)) {<br />
MUIDisplayError(ERROR_WRITE_BOOT, Ir, POPUP_WAIT_ENTER);<br />
return QUIT_PAGE;<br />
}<br />
/* Step 2: Write the MBR */<br />
writes bootcd '\loader\dosmbr.bin' into the MBR-place<br />
</pre><br />
<br />
'''InstallVBRToPartition'''/4 (@/base/setup/usetup/bootsup.c)<br />
<pre><br />
InstallVBRToPartition():<br />
if (PartitionType is FAT_PartitionType )<br />
return InstallFatBootcodeToPartition/4<br />
else return STATUS_UNSUCCESSFUL;<br />
</pre><br />
<br />
{| class="wikitable"<br />
|-<br />
! FAT_PartitionType <br />
|-<br />
| PARTITION_FAT_12<br />
|-<br />
| PARTITION_FAT_16<br />
|-<br />
| PARTITION_HUGE<br />
|-<br />
| PARTITION_XINT13<br />
|-<br />
| PARTITION_FAT32<br />
|-<br />
| PARTITION_FAT32_XINT13<br />
|}<br />
<br />
'''InstallFatBootcodeToPartition'''()/4:<br />
<br />
Copies original bootsector file to: %DEST%''\bootsect.ros'' file.<br />
{| class="wikitable"<br />
|-<br />
! FS ID/PartitionType !! Freeloader boot sector binary original name !! Source file name<br />
|-<br />
| FAT32: PARTITION_FAT32, PARTITION_FAT32_XINT13|| fat32.bin || fat32.S<br />
|-<br />
| FAT16: ''else''-branche of ''if''|| fat.bin || fat.S<br />
|-<br />
| otherwise something is failed|| - || -<br />
|}<br />
<br />
InstallFatBootcodeToPartition calls: InstallFat[16/32]BootCodeToDisk or InstallFat[16/32]BootCodeToFile<br />
* Depending on bootloader (ntldr+boot.ini; not recognized/absent; existing freeldr) does different things<br />
* For ntldr bootloader case writes it to file 'bootsect.ros' and changes boot.ini file<br />
* In case of changing existing freeldr installetion - stores existing boot sector to 'BOOTSECT.OLD'<br />
<br />
'''Legacy''': Also there is a (pretty old,circa 2001) component in ReactOS source: '''''installfreeldr''''' (source: /boot/freeldr/install; binary: unknown). It writes FAT32 MBR only.<br />
<br />
==Boot record types (MBR, VBR, boot sectors, boot records of boot cd/livecd==<br />
TBW: ''InstallFatBootcodeToPartition''-sourced + others (isoboot + ext2(?) etc)<br />
<br />
Parameters boot record passes to FreeLdr: (fat32 & cdrom) (?fat16 doesn't pass DH?)<br />
* boot drive number in DL register. It is BIOS drive number: 0x80 is the 1st drive, 0x81 - 2nd etc.<br />
* boot partition number (0-based) in DH register (0 for CDROM)<br />
<br />
=bootcd during 1st stage setup: FreeLoader, usetup.exe, and boot options=<br />
* ''Note: ReactOS 1st stage setup run by usetup.exe shouldn't be confused with 1st stage loading of (ReactOS or GRUB) bootloader. These are totally different things.''<br />
** ''GRUB loading stages are: 1st stage: loading the MBR, 1.5 stage (...), 2nd stage: running modules from grub host filesystem, from (hdX,msdosY)/boot/grub/i386-pc/*.mod''<br />
<br />
==usetup.exe==<br />
bootcd main installer module is a '''usetup.exe''' (@\base\setup\usetup\*)<br />
<br />
usetup.exe is:<br />
* nativecui module<br />
* Uses libraries: zlib, inflib, ext2lib, vfatlib<br />
<br />
==BootOptions of bootcd==<br />
<br />
BootOptions of bootcd are: '/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE'<br />
<br />
It is set up by freeldr.sys in:<br />
<pre><br />
(../../boot/freeldr/freeldr/windows/setupldr.c:219) trace: BootOptions: '/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE'<br />
</pre><br />
Is read by LoadReactOSSetup(): by setup method of ntoskrnl-loader; designed for usetup.exe.<br />
<br />
Specified in: bootcd.ISO\reactos\txtsetup.sif : SetupData/[Dbg]OsLoadOptions :<br />
<pre><br />
{setupldr.c: InfFindFirstLine(InfHandle, "SetupData", "OsLoadOptions", &InfContext)<br />
or {<br />
{setupldr.c: InfFindFirstLine(InfHandle, "SetupData", "DbgOsLoadOptions", &InfContext)<br />
depending of DBG variable (DBG is now defined by default).<br />
</pre><br />
The source file copied to bootcd.ISO is: \boot\bootdata\txtsetup.sif<br />
<pre><br />
...<br />
[SetupData]<br />
DefaultPath = \ReactOS<br />
OsLoadOptions = "/NOGUIBOOT /NODEBUG"<br />
DbgOsLoadOptions = "/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE"<br />
...<br />
</pre><br />
<br />
== bootcd - Blue TextUI MessageBox "Opening hive file failed!" ==<br />
<br />
Blue TextUI MessageBox "Opening hive file failed!" <br />
<br />
Is a symptom of trying to run bootcd as normal reactos installation, with should has registry.<br />
<br />
bootcd hasn't any registry installed. (look for file: %Root%\SYSTEM32\CONFIG\SYSTEM)<br />
<pre><br />
wlregistry.c: UiMessageBox("Opening hive file failed!");<br />
</pre><br />
of /boot/freeldr/freeldr/windows/wlregistry.c<br />
<br />
'''WinLdrLoadSystemHive()/3'''<br />
<pre><br />
BOOLEAN<br />
WinLdrLoadSystemHive(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock,<br />
IN LPCSTR DirectoryPath,<br />
IN LPCSTR HiveName)<br />
/* Concatenate path and filename to get the full name */<br />
strcpy(FullHiveName, DirectoryPath);<br />
strcat(FullHiveName, HiveName);<br />
//Print(L"Loading %s...\n", FullHiveName);<br />
Status = ArcOpen(FullHiveName, OpenReadOnly, &FileId);<br />
<br />
if (Status != ESUCCESS)<br />
{<br />
*** UiMessageBox("Opening hive file failed!");<br />
return FALSE;<br />
}<br />
</pre><br />
'''WinLdrScanSystemHive()''' calls '''WinLdrLoadSystemHive()'''<br />
<pre><br />
BOOLEAN WinLdrScanSystemHive()/2<br />
strcpy(SearchPath, DirectoryPath);<br />
strcat(SearchPath, "SYSTEM32\\CONFIG\\");<br />
Status = WinLdrLoadSystemHive(LoaderBlock, SearchPath, "SYSTEM");<br />
// Fail if failed...<br />
if (!Status) <br />
return FALSE;<br />
</pre><br />
<br />
== How bootcd is built ==<br />
<br />
Quote from \boot\CMakeLists.txt:<br />
<pre><br />
add_custom_target(bootcd<br />
COMMAND native-cdmake -j -m -b ${CMAKE_CURRENT_BINARY_DIR}/freeldr/bootsect/isoboot.bin \<br />
@${CMAKE_CURRENT_BINARY_DIR}/bootcd.lst REACTOS ${REACTOS_BINARY_DIR}/bootcd.iso<br />
DEPENDS native-cdmake<br />
VERBATIM)<br />
</pre><br />
CMAKE_CURRENT_BINARY_DIR = \output-MinGW-i386\reactos\boot<br />
<br />
'''How livecd is built:'''<br />
<br />
Quote from \boot\CMakeLists.txt:<br />
<pre><br />
add_custom_target(livecd<br />
COMMAND native-cdmake -j -m -b ${CMAKE_CURRENT_BINARY_DIR}/freeldr/bootsect/isoboot.bin \<br />
@${CMAKE_CURRENT_BINARY_DIR}/livecd.lst REACTOS ${REACTOS_BINARY_DIR}/livecd.iso<br />
DEPENDS native-cdmake<br />
VERBATIM)<br />
</pre><br />
<br />
'''How isoboot.bin file is built:'''<br />
<pre>CreateBootSectorTarget(isoboot ${CMAKE_CURRENT_SOURCE_DIR}/isoboot.S ${CMAKE_CURRENT_BINARY_DIR}/isoboot.bin 7000)<br />
</pre><br />
<br />
'''freeldr.sys on livecd:'''<br />
freeldr.sys on Livecd is renamed to setupldr.sys because isoboot.bin looks for setupldr.sys<br />
<br />
= ntoskrnl.exe loading and start =<br />
Entry point : _KiSystemStartup@4; subsystem:native<br />
<br />
===ntoskrnl Executive components initialization===<br />
<br />
\ntoskrnl\ex\init.c : Phase1InitializationDiscard(PVOID Context)<br />
<br />
initialize memory, registry, other important things.</div>Mna.https://reactos.org/wiki/index.php?title=QEMU&diff=34674QEMU2014-03-26T07:02:24Z<p>Mna.: </p>
<hr />
<div>[http://www.qemu.org/ QEMU] is a free x86 emulator for Linux and Windows. A [http://www.reactos.org/download preloaded QEMU image of ReactOS] can be found [http://www.reactos.org/download here].<br />
<br />
If you are looking for a faster virtual machine, give [[VirtualBox]] or [[VMware]] a try.<br />
<br />
== Installing ReactOS on QEMU ==<br />
<br />
* Create a drive image, on which ReactOS will be installed, by typing:<br />
<br />
qemu-img create ReactOS.img 1000M<br />
<br />
''1000M'' stands for 1000 megabytes- that shall be enough. It shall be greater, if you plan to install some application to try under ReactOS.<br />
<br />
* In *nix only, type:<br />
<br />
sudo umount /dev/shm<br />
sudo mount -t tmpfs -o size=144m none /dev/shm<br />
<br />
* Type:<br />
<br />
qemu -L . -m 256 -cdrom ReactOS.iso -hda ReactOS.img -boot d -localtime -serial file:ReactOS.log<br />
<br />
''-m 256'' stand for 256MB RAM<br />
''-boot d'' instructs QEMU to boot from the CD-ROM. Without ''-boot d'' it will boot from the hard drive (Reactos.img).<br />
<br />
''ReactOS.iso'' is the image of the '''installation''' CD, which can be downloaded from http://www.reactos.org/en/download.html<br />
<br />
When reinstalling ReactOS, perform steps 2 (if necessary) and 3 only.<br />
<br />
If you want to copy some files to ReactOS, you could create an CD-ROM image and mount it on QEMU.<br />
You can run QEMU this way:<br />
<br />
qemu -L . -m 256 -cdrom Applications.iso -hda ReactOS.img -localtime -serial file:ReactOS.log<br />
<br />
=== Setting up Sound ===<br />
<br />
==== Using AC97 emulation (QEMU 0.10.1 or later) ====<br />
<br />
* Set emulation to AC97 (-soundhw ac97)<br />
* Install the drivers using Downloader! (You need to reboot twice)<br />
<br />
===== Known Issues =====<br />
<br />
* Audio sounds glitch when changing the audio stream with a high sample rate to a stream with low sample rate<br />
<br />
==== Using ES1370MP emulation ====<br />
<br />
* Set emulation to ES1370 (-soundhw es1370)<br />
* Install drivers from here [http://rapidshare.com/files/236843299/windows2.zip.html]<br />
* Create a file named import.reg with the following contents<br />
<br />
<pre><br />
REGEDIT4<br />
<br />
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E96C-E325-11CE-BFC1-08002BE10318}\0000\Settings]<br />
"WaveVol_Left"=dword:00040000<br />
"WaveVol_Right"=dword:00040000<br />
"WaveLineSM"=dword:00000000<br />
"WaveWaveInSM_Left"=dword:01010101<br />
"WaveWaveInSM_Right"=dword:00000000<br />
"CDVol_Left"=dword:fffffff6<br />
"CDVol_Right"=dword:fffffff6<br />
"CDLineSM"=dword:00000000<br />
"CDWaveInSM_Left"=dword:00000000<br />
"CDWaveInSM_Right"=dword:00000000<br />
"LineInVol_Left"=dword:fffffff6<br />
"LineInVol_Right"=dword:fffffff6<br />
"LineLineSM"=dword:01000001<br />
"LineWaveInSM_Left"=dword:00000000<br />
"LineWaveInSM_Right"=dword:00000000<br />
"MicBoost"=dword:00000001<br />
"MicVol"=dword:fffffff6<br />
"MicLineMute"=dword:00000001<br />
"MicWaveInSM_Left"=dword:00000000<br />
"MicWaveInSM_Right"=dword:00000000<br />
"AuxVol_Left"=dword:fffffff6<br />
"AuxVol_Right"=dword:fffffff6<br />
"AuxLineSM"=dword:00000000<br />
"AuxWaveInSM_Left"=dword:00000000<br />
"AuxWaveInSM_Right"=dword:00000000<br />
"PhoneVol"=dword:fffffff6<br />
"PhoneMute"=dword:00000000<br />
"PhoneWaveInSM_Left"=dword:00000000<br />
"PhoneWaveInSM_Right"=dword:00000000<br />
"LineOutVol_Left"=dword:fff9f203<br />
"LineOutVol_Right"=dword:fff9f203<br />
"LineOutMute"=dword:00000000<br />
</pre><br />
<br />
* Import those settings by starting cmd.exe and regedit import.reg<br />
* Reboot<br />
<br />
If you don't hear any sound in '''QEMU 0.10.x''', you'll have to set QEMU_AUDIO_DRV=fmod (available: dsound; fmod; sdl; none ; wav (dump to file) - see QEMU documentation for information.<br />
<br />
===== Known Issues =====<br />
<br />
After starting first audio stream, you need to leave QEMU and re-enter (seems to be a QEMU bug)<br />
<br />
=== Setting up network ===<br />
<br />
Networking should work by itself using the '-net nic,model=ne2k_pci' and '-net user' switches with QEMU.<br />
<br />
== Using ReactOS [[LiveCD]] on QEMU ==<br />
<br />
# Move to the previously created directory with the <code>cd</code> command.<br />
# There, type in the following command:<br />
<br />
qemu -L <Path to your QEMU folder>\bios -cdrom <filename>.iso -m 64<br />
<br />
== Grabbing debug messages ==<br />
<br />
By default, ReactOS debug messages are sent to the serial port (COM1).<br />
For grabbing that output, you need QEMU version 0.6.1 or later, in which you can specify the -serial option.<br />
<br />
Valid arguments to -serial include file names, pipes, COM Ports and [http://www.qemu.org/qemu-doc.html#SEC10 more].<br />
Those arguments could be:<br />
<br />
-serial file:"C:\roslog.txt"<br />
-serial pipe:"\\pipe1\"<br />
-serial COM4<br />
<br />
=== Redirect to a file ===<br />
<br />
If you're using the QEMU virtual machine and want to redirect the serial output to a file, add the following to your QEMU command line:<br />
-serial file:''FILENAME''<br />
<br />
Replace ''FILENAME'' with the name of a file, into which the debug output shall be written.<br />
<br />
=== Redirect to the console ===<br />
<br />
The method above redirects the output to a file. If you want to redirect it to the console, there are two different methods. They depend on the operating system you run QEMU under.<br />
<br />
* Under Windows, add the following to your QEMU command line: <pre>-serial file:CON</pre><br />
* Under a Unix-based operating system, add the following to your QEMU command line: <pre>-serial stdio</pre><br />
<br />
=== Serial port connection using com0com ===<br />
<br />
Setup the com0com driver like explained in this [[com0com|com0com guide]].<br />
<br />
Add the following option to your QEMU command line<br />
<br />
-serial COM4<br />
<br />
Write "COM4" with capital letters otherwise QEMU won't use the serial port at all!<br />
<br />
Open your terminal program and start a new connection to your second virtual port. If that port is not listed, try COM4.<br />
<br />
Another option is to use the [http://svn.reactos.org/downloads/RosTE-0.1.exe ReactOS Test Environment] instead of setting this up manually.<br />
<br />
== KQEMU ==<br />
<br />
If you feel that QEMU is too slow for you, consider using the KQEMU module.<br />
<br />
Pleas bear in mind that it just works with QEMU up to 0.11 and isn't maintained anymore.<br />
<br />
[http://www.reactos.org/forum/viewtopic.php?f=22&t=1065 Tutorial] by mikedep333<br />
<br />
== See also ==<br />
* [[Transfer files from the host OS to the virtual drive]]<br />
<br />
[[Category:Tutorial]]<br />
[[Category:Virtualization software]]</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna./FreeLoader,_bootcd_and_bootrecords&diff=34670User:Mna./FreeLoader, bootcd and bootrecords2014-03-25T11:33:25Z<p>Mna.: /* BootOptions of bootcd */</p>
<hr />
<div>=FreeLoader freeldr Architecture=<br />
<br />
==FreeLoader Initialization==<br />
When FreeLoader gets control it <br />
* saves the boot drive, passed to it in the DL register, partition number passed in the DH register<br />
* sets up the stack, <br />
* enables protected mode, and <br />
* calls BootMain().<br />
--based on quote from \boot\freeldr\notes.txt<br />
<br />
==Freeloader calls hierarchy==<br />
===BootMain===<br />
VOID BootMain(LPSTR CmdLine) is layed in \boot\freeldr\freeldr\freeldr.c<br />
<br />
It is main Freeldr function:<br />
<br />
<pre><br />
VOID BootMain(LPSTR CmdLine)<br />
{<br />
CmdLineParse(CmdLine);<br />
MachInit(CmdLine);<br />
FsInit();<br />
DebugInit();<br />
TRACE("BootMain() called.\n");<br />
<br />
if (!UiInitialize(FALSE))<br />
{<br />
UiMessageBoxCritical("Unable to initialize UI.\n");<br />
goto quit;<br />
}<br />
if (!MmInitializeMemoryManager())<br />
{<br />
UiMessageBoxCritical("Unable to initialize memory manager");<br />
goto quit;<br />
}<br />
#ifdef _M_IX86<br />
HalpInitializePciStubs();<br />
HalpInitBusHandler();<br />
#endif<br />
RunLoader();<br />
<br />
quit:<br />
/* If we reach this point, something went wrong before, therefore reboot */<br />
DiskStopFloppyMotor();<br />
Reboot();<br />
}<br />
</pre><br />
<br />
\boot\freeldr\freeldr\debug.c : DebugInit()<br />
Initializes Rs232 port, among other things.<br />
<br />
===OS_LOADING_METHOD===<br />
'''BootMain'''() calls '''RunLoader'''() //''bootmgr.c''<br />
<br />
'''RunLoader'''() calls '''LoadOperatingSystem'''()<br />
<br />
'''LoadOperatingSystem'''() lookups the OS_LOADING_METHOD and calls found ''loading method''.<br />
<br />
//VOID LoadOperatingSystem(IN OperatingSystemItem* OperatingSystem); //''@\boot\freeldr\freeldr\bootmgr.c''<br />
<br />
OS_LOADING_METHOD is a function pointer field in the table of OSLoadingMethods (in bootmgr.c) :<br />
<pre><br />
typedef VOID (*OS_LOADING_METHOD)(IN OperatingSystemItem* OperatingSystem,<br />
IN USHORT OperatingSystemVersion);<br />
</pre><br />
Most used ''loading methods'' are: LoadAndBootWindows(), LoadReactOSSetup() (@''\boot\freeldr\freeldr\windows\ {winldr.c,setupldr.c}'' )<br />
<br />
* Windows2003/'''LoadAndBootWindows'''() is a normal/default loading method, called by installed ReactOS.<br />
* ReactOSSetup/'''LoadReactOSSetup'''() is a method called by ReactOS bootcd installer ''usetup.exe''.<br />
<br />
List of all ReactOS loading methods:<br />
<pre><br />
{"ReactOSSetup", 0 , LoadReactOSSetup },<br />
#ifdef _M_IX86<br />
{"BootSector" , 0 , LoadAndBootBootSector},<br />
{"Drive" , 0 , LoadAndBootDrive },<br />
{"Partition" , 0 , LoadAndBootPartition },<br />
<br />
{"Linux" , 0 , LoadAndBootLinux },<br />
<br />
{"Windows" , 0 , LoadAndBootWindows },<br />
{"WindowsNT40" , _WIN32_WINNT_NT4 , LoadAndBootWindows },<br />
#endif<br />
{"Windows2003" , _WIN32_WINNT_WS03, LoadAndBootWindows },<br />
</pre><br />
<br />
=== DoOptionsMenu() ===<br />
Options menu is activated by pressing F8 key.<br />
<br />
RunLoader() checks keys and activates; calls DoOptionsMenu() (options.c)<br />
<br />
=Boot records and FreeLoader=<br />
freeldr.sys is started by some type of BootRecord (BR): MBR, VBR, CD boot sector.<br />
<br />
==How bootcd installer usetup.exe writes MBR==<br />
When installing the ReactOS some component should write MBR/VBR to let freeldr.sys start at boot time.<br />
<br />
This is done by usetup.exe : <br />
* BootLoaderHarddiskMbrPage(&Ir) and its helpers: <br />
** InstallMbrBootCodeToDisk()/2 and <br />
** InstallVBRToPartition()/4.<br />
*** InstallFatBootcodeToPartition()/4<br />
<br />
<pre><br />
/** Side note related with bug in usetup.exe -bug writing MBR/VBR in some (frequent) cases: */<br />
<br />
MBRInstallType: usetup.exe variable keeps Boot Record installation mode:<br />
0-None (skip installation) 1-floppy MBR 2-Hdd MBR & VBR <br />
Files:<br />
/base/setup/reactos/ reactos.c : struct SetupData has field MBRInstallType<br />
/base/setup/usetup/interface/ usetup.c : use of MBRInstallType data.<br />
</pre><br />
<br />
'''usetup.exe''' : Page '''''BOOT_LOADER_HARDDISK_MBR_PAGE''''' is handled by: BootLoaderHarddiskMbrPage(&Ir);<br />
( @/base/setup/usetup/interface/usetup.c)<br />
<br />
'''BootLoaderHarddiskMbrPage''' function creates/writes MBR and VBR records.<br />
<br />
''/*** So the main errors are here: This function somehow is not called or the call/subcalls are failed. */''<br />
<br />
<pre><br />
BootLoaderHarddiskMbrPage(&Ir);<br />
/* Step 1: Write the VBR */<br />
InstallVBRToPartition()/4<br />
if (!NT_SUCCESS(Status)) {<br />
MUIDisplayError(ERROR_WRITE_BOOT, Ir, POPUP_WAIT_ENTER);<br />
return QUIT_PAGE;<br />
}<br />
/* Step 2: Write the MBR */<br />
writes bootcd '\loader\dosmbr.bin' into the MBR-place<br />
</pre><br />
<br />
'''InstallVBRToPartition'''/4 (@/base/setup/usetup/bootsup.c)<br />
<pre><br />
InstallVBRToPartition():<br />
if (PartitionType is FAT_PartitionType )<br />
return InstallFatBootcodeToPartition/4<br />
else return STATUS_UNSUCCESSFUL;<br />
</pre><br />
<br />
{| class="wikitable"<br />
|-<br />
! FAT_PartitionType <br />
|-<br />
| PARTITION_FAT_12<br />
|-<br />
| PARTITION_FAT_16<br />
|-<br />
| PARTITION_HUGE<br />
|-<br />
| PARTITION_XINT13<br />
|-<br />
| PARTITION_FAT32<br />
|-<br />
| PARTITION_FAT32_XINT13<br />
|}<br />
<br />
'''InstallFatBootcodeToPartition'''()/4:<br />
<br />
Copies original bootsector file to: %DEST%''\bootsect.ros'' file.<br />
{| class="wikitable"<br />
|-<br />
! FS ID/PartitionType !! Freeloader boot sector binary original name !! Source file name<br />
|-<br />
| FAT32: PARTITION_FAT32, PARTITION_FAT32_XINT13|| fat32.bin || fat32.S<br />
|-<br />
| FAT16: ''else''-branche of ''if''|| fat.bin || fat.S<br />
|-<br />
| otherwise something is failed|| - || -<br />
|}<br />
<br />
InstallFatBootcodeToPartition calls: InstallFat[16/32]BootCodeToDisk or InstallFat[16/32]BootCodeToFile<br />
* Depending on bootloader (ntldr+boot.ini; not recognized/absent; existing freeldr) does different things<br />
* For ntldr bootloader case writes it to file 'bootsect.ros' and changes boot.ini file<br />
* In case of changing existing freeldr installetion - stores existing boot sector to 'BOOTSECT.OLD'<br />
<br />
'''Legacy''': Also there is a (pretty old,circa 2001) component in ReactOS source: '''''installfreeldr''''' (source: /boot/freeldr/install; binary: unknown). It writes FAT32 MBR only.<br />
<br />
==Boot record types (MBR, VBR, boot sectors, boot records of boot cd/livecd==<br />
TBW: ''InstallFatBootcodeToPartition''-sourced + others (isoboot + ext2(?) etc)<br />
<br />
Parameters boot record passes to FreeLdr: (fat32 & cdrom) (?fat16 doesn't pass DH?)<br />
* boot drive number in DL register. It is BIOS drive number: 0x80 is the 1st drive, 0x81 - 2nd etc.<br />
* boot partition number (0-based) in DH register (0 for CDROM)<br />
<br />
=bootcd during 1st stage setup: FreeLoader, usetup.exe, and boot options=<br />
* ''Note: ReactOS 1st stage setup run by usetup.exe shouldn't be confused with 1st stage loading of (ReactOS or GRUB) bootloader. These are totally different things.''<br />
** ''GRUB loading stages are: 1st stage: loading the MBR, 1.5 stage (...), 2nd stage: running modules from grub host filesystem, from (hdX,msdosY)/boot/grub/i386-pc/*.mod''<br />
<br />
==usetup.exe==<br />
bootcd main installer module is a '''usetup.exe''' (@\base\setup\usetup\*)<br />
<br />
usetup.exe is:<br />
* nativecui module<br />
* Uses libraries: zlib, inflib, ext2lib, vfatlib<br />
<br />
==BootOptions of bootcd==<br />
<br />
BootOptions of bootcd are: '/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE'<br />
<br />
It is set up by freeldr.sys in:<br />
<pre><br />
(../../boot/freeldr/freeldr/windows/setupldr.c:219) trace: BootOptions: '/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE'<br />
</pre><br />
Is read by LoadReactOSSetup(): by setup method of ntoskrnl-loader; designed for usetup.exe.<br />
<br />
Specified in: bootcd.ISO\reactos\txtsetup.sif : SetupData/[Dbg]OsLoadOptions :<br />
<pre><br />
{setupldr.c: InfFindFirstLine(InfHandle, "SetupData", "OsLoadOptions", &InfContext)<br />
or {<br />
{setupldr.c: InfFindFirstLine(InfHandle, "SetupData", "DbgOsLoadOptions", &InfContext)<br />
depending of DBG variable (DBG is now defined by default).<br />
</pre><br />
The source file copied to bootcd.ISO is: \boot\bootdata\txtsetup.sif<br />
<pre><br />
...<br />
[SetupData]<br />
DefaultPath = \ReactOS<br />
OsLoadOptions = "/NOGUIBOOT /NODEBUG"<br />
DbgOsLoadOptions = "/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE"<br />
...<br />
</pre><br />
<br />
== bootcd - Blue TextUI MessageBox "Opening hive file failed!" ==<br />
<br />
Blue TextUI MessageBox "Opening hive file failed!" <br />
<br />
Is a symptom of trying to run bootcd as normal reactos installation, with should has registry.<br />
<br />
bootcd hasn't any registry installed. (look for file: %Root%\SYSTEM32\CONFIG\SYSTEM)<br />
<pre><br />
wlregistry.c: UiMessageBox("Opening hive file failed!");<br />
</pre><br />
of /boot/freeldr/freeldr/windows/wlregistry.c<br />
<br />
'''WinLdrLoadSystemHive()/3'''<br />
<pre><br />
BOOLEAN<br />
WinLdrLoadSystemHive(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock,<br />
IN LPCSTR DirectoryPath,<br />
IN LPCSTR HiveName)<br />
/* Concatenate path and filename to get the full name */<br />
strcpy(FullHiveName, DirectoryPath);<br />
strcat(FullHiveName, HiveName);<br />
//Print(L"Loading %s...\n", FullHiveName);<br />
Status = ArcOpen(FullHiveName, OpenReadOnly, &FileId);<br />
<br />
if (Status != ESUCCESS)<br />
{<br />
*** UiMessageBox("Opening hive file failed!");<br />
return FALSE;<br />
}<br />
</pre><br />
'''WinLdrScanSystemHive()''' calls '''WinLdrLoadSystemHive()'''<br />
<pre><br />
BOOLEAN WinLdrScanSystemHive()/2<br />
strcpy(SearchPath, DirectoryPath);<br />
strcat(SearchPath, "SYSTEM32\\CONFIG\\");<br />
Status = WinLdrLoadSystemHive(LoaderBlock, SearchPath, "SYSTEM");<br />
// Fail if failed...<br />
if (!Status) <br />
return FALSE;<br />
</pre><br />
<br />
== How bootcd is built ==<br />
<br />
Quote from \boot\CMakeLists.txt:<br />
<pre><br />
add_custom_target(bootcd<br />
COMMAND native-cdmake -j -m -b ${CMAKE_CURRENT_BINARY_DIR}/freeldr/bootsect/isoboot.bin \<br />
@${CMAKE_CURRENT_BINARY_DIR}/bootcd.lst REACTOS ${REACTOS_BINARY_DIR}/bootcd.iso<br />
DEPENDS native-cdmake<br />
VERBATIM)<br />
</pre><br />
CMAKE_CURRENT_BINARY_DIR = \output-MinGW-i386\reactos\boot<br />
<br />
'''How livecd is built:'''<br />
<br />
Quote from \boot\CMakeLists.txt:<br />
<pre><br />
add_custom_target(livecd<br />
COMMAND native-cdmake -j -m -b ${CMAKE_CURRENT_BINARY_DIR}/freeldr/bootsect/isoboot.bin \<br />
@${CMAKE_CURRENT_BINARY_DIR}/livecd.lst REACTOS ${REACTOS_BINARY_DIR}/livecd.iso<br />
DEPENDS native-cdmake<br />
VERBATIM)<br />
</pre><br />
<br />
'''How isoboot.bin file is built:'''<br />
<pre>CreateBootSectorTarget(isoboot ${CMAKE_CURRENT_SOURCE_DIR}/isoboot.S ${CMAKE_CURRENT_BINARY_DIR}/isoboot.bin 7000)<br />
</pre><br />
<br />
'''freeldr.sys on livecd:'''<br />
freeldr.sys on Livecd is renamed to setupldr.sys because isoboot.bin looks for setupldr.sys<br />
<br />
= ntoskrnl.exe loading and start =<br />
Entry point : _KiSystemStartup@4; subsystem:native</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna./FreeLoader,_bootcd_and_bootrecords&diff=34669User:Mna./FreeLoader, bootcd and bootrecords2014-03-25T11:14:15Z<p>Mna.: /* How bootcd installer usetup.exe writes MBR */</p>
<hr />
<div>=FreeLoader freeldr Architecture=<br />
<br />
==FreeLoader Initialization==<br />
When FreeLoader gets control it <br />
* saves the boot drive, passed to it in the DL register, partition number passed in the DH register<br />
* sets up the stack, <br />
* enables protected mode, and <br />
* calls BootMain().<br />
--based on quote from \boot\freeldr\notes.txt<br />
<br />
==Freeloader calls hierarchy==<br />
===BootMain===<br />
VOID BootMain(LPSTR CmdLine) is layed in \boot\freeldr\freeldr\freeldr.c<br />
<br />
It is main Freeldr function:<br />
<br />
<pre><br />
VOID BootMain(LPSTR CmdLine)<br />
{<br />
CmdLineParse(CmdLine);<br />
MachInit(CmdLine);<br />
FsInit();<br />
DebugInit();<br />
TRACE("BootMain() called.\n");<br />
<br />
if (!UiInitialize(FALSE))<br />
{<br />
UiMessageBoxCritical("Unable to initialize UI.\n");<br />
goto quit;<br />
}<br />
if (!MmInitializeMemoryManager())<br />
{<br />
UiMessageBoxCritical("Unable to initialize memory manager");<br />
goto quit;<br />
}<br />
#ifdef _M_IX86<br />
HalpInitializePciStubs();<br />
HalpInitBusHandler();<br />
#endif<br />
RunLoader();<br />
<br />
quit:<br />
/* If we reach this point, something went wrong before, therefore reboot */<br />
DiskStopFloppyMotor();<br />
Reboot();<br />
}<br />
</pre><br />
<br />
\boot\freeldr\freeldr\debug.c : DebugInit()<br />
Initializes Rs232 port, among other things.<br />
<br />
===OS_LOADING_METHOD===<br />
'''BootMain'''() calls '''RunLoader'''() //''bootmgr.c''<br />
<br />
'''RunLoader'''() calls '''LoadOperatingSystem'''()<br />
<br />
'''LoadOperatingSystem'''() lookups the OS_LOADING_METHOD and calls found ''loading method''.<br />
<br />
//VOID LoadOperatingSystem(IN OperatingSystemItem* OperatingSystem); //''@\boot\freeldr\freeldr\bootmgr.c''<br />
<br />
OS_LOADING_METHOD is a function pointer field in the table of OSLoadingMethods (in bootmgr.c) :<br />
<pre><br />
typedef VOID (*OS_LOADING_METHOD)(IN OperatingSystemItem* OperatingSystem,<br />
IN USHORT OperatingSystemVersion);<br />
</pre><br />
Most used ''loading methods'' are: LoadAndBootWindows(), LoadReactOSSetup() (@''\boot\freeldr\freeldr\windows\ {winldr.c,setupldr.c}'' )<br />
<br />
* Windows2003/'''LoadAndBootWindows'''() is a normal/default loading method, called by installed ReactOS.<br />
* ReactOSSetup/'''LoadReactOSSetup'''() is a method called by ReactOS bootcd installer ''usetup.exe''.<br />
<br />
List of all ReactOS loading methods:<br />
<pre><br />
{"ReactOSSetup", 0 , LoadReactOSSetup },<br />
#ifdef _M_IX86<br />
{"BootSector" , 0 , LoadAndBootBootSector},<br />
{"Drive" , 0 , LoadAndBootDrive },<br />
{"Partition" , 0 , LoadAndBootPartition },<br />
<br />
{"Linux" , 0 , LoadAndBootLinux },<br />
<br />
{"Windows" , 0 , LoadAndBootWindows },<br />
{"WindowsNT40" , _WIN32_WINNT_NT4 , LoadAndBootWindows },<br />
#endif<br />
{"Windows2003" , _WIN32_WINNT_WS03, LoadAndBootWindows },<br />
</pre><br />
<br />
=== DoOptionsMenu() ===<br />
Options menu is activated by pressing F8 key.<br />
<br />
RunLoader() checks keys and activates; calls DoOptionsMenu() (options.c)<br />
<br />
=Boot records and FreeLoader=<br />
freeldr.sys is started by some type of BootRecord (BR): MBR, VBR, CD boot sector.<br />
<br />
==How bootcd installer usetup.exe writes MBR==<br />
When installing the ReactOS some component should write MBR/VBR to let freeldr.sys start at boot time.<br />
<br />
This is done by usetup.exe : <br />
* BootLoaderHarddiskMbrPage(&Ir) and its helpers: <br />
** InstallMbrBootCodeToDisk()/2 and <br />
** InstallVBRToPartition()/4.<br />
*** InstallFatBootcodeToPartition()/4<br />
<br />
<pre><br />
/** Side note related with bug in usetup.exe -bug writing MBR/VBR in some (frequent) cases: */<br />
<br />
MBRInstallType: usetup.exe variable keeps Boot Record installation mode:<br />
0-None (skip installation) 1-floppy MBR 2-Hdd MBR & VBR <br />
Files:<br />
/base/setup/reactos/ reactos.c : struct SetupData has field MBRInstallType<br />
/base/setup/usetup/interface/ usetup.c : use of MBRInstallType data.<br />
</pre><br />
<br />
'''usetup.exe''' : Page '''''BOOT_LOADER_HARDDISK_MBR_PAGE''''' is handled by: BootLoaderHarddiskMbrPage(&Ir);<br />
( @/base/setup/usetup/interface/usetup.c)<br />
<br />
'''BootLoaderHarddiskMbrPage''' function creates/writes MBR and VBR records.<br />
<br />
''/*** So the main errors are here: This function somehow is not called or the call/subcalls are failed. */''<br />
<br />
<pre><br />
BootLoaderHarddiskMbrPage(&Ir);<br />
/* Step 1: Write the VBR */<br />
InstallVBRToPartition()/4<br />
if (!NT_SUCCESS(Status)) {<br />
MUIDisplayError(ERROR_WRITE_BOOT, Ir, POPUP_WAIT_ENTER);<br />
return QUIT_PAGE;<br />
}<br />
/* Step 2: Write the MBR */<br />
writes bootcd '\loader\dosmbr.bin' into the MBR-place<br />
</pre><br />
<br />
'''InstallVBRToPartition'''/4 (@/base/setup/usetup/bootsup.c)<br />
<pre><br />
InstallVBRToPartition():<br />
if (PartitionType is FAT_PartitionType )<br />
return InstallFatBootcodeToPartition/4<br />
else return STATUS_UNSUCCESSFUL;<br />
</pre><br />
<br />
{| class="wikitable"<br />
|-<br />
! FAT_PartitionType <br />
|-<br />
| PARTITION_FAT_12<br />
|-<br />
| PARTITION_FAT_16<br />
|-<br />
| PARTITION_HUGE<br />
|-<br />
| PARTITION_XINT13<br />
|-<br />
| PARTITION_FAT32<br />
|-<br />
| PARTITION_FAT32_XINT13<br />
|}<br />
<br />
'''InstallFatBootcodeToPartition'''()/4:<br />
<br />
Copies original bootsector file to: %DEST%''\bootsect.ros'' file.<br />
{| class="wikitable"<br />
|-<br />
! FS ID/PartitionType !! Freeloader boot sector binary original name !! Source file name<br />
|-<br />
| FAT32: PARTITION_FAT32, PARTITION_FAT32_XINT13|| fat32.bin || fat32.S<br />
|-<br />
| FAT16: ''else''-branche of ''if''|| fat.bin || fat.S<br />
|-<br />
| otherwise something is failed|| - || -<br />
|}<br />
<br />
InstallFatBootcodeToPartition calls: InstallFat[16/32]BootCodeToDisk or InstallFat[16/32]BootCodeToFile<br />
* Depending on bootloader (ntldr+boot.ini; not recognized/absent; existing freeldr) does different things<br />
* For ntldr bootloader case writes it to file 'bootsect.ros' and changes boot.ini file<br />
* In case of changing existing freeldr installetion - stores existing boot sector to 'BOOTSECT.OLD'<br />
<br />
'''Legacy''': Also there is a (pretty old,circa 2001) component in ReactOS source: '''''installfreeldr''''' (source: /boot/freeldr/install; binary: unknown). It writes FAT32 MBR only.<br />
<br />
==Boot record types (MBR, VBR, boot sectors, boot records of boot cd/livecd==<br />
TBW: ''InstallFatBootcodeToPartition''-sourced + others (isoboot + ext2(?) etc)<br />
<br />
Parameters boot record passes to FreeLdr: (fat32 & cdrom) (?fat16 doesn't pass DH?)<br />
* boot drive number in DL register. It is BIOS drive number: 0x80 is the 1st drive, 0x81 - 2nd etc.<br />
* boot partition number (0-based) in DH register (0 for CDROM)<br />
<br />
=bootcd during 1st stage setup: FreeLoader, usetup.exe, and boot options=<br />
* ''Note: ReactOS 1st stage setup run by usetup.exe shouldn't be confused with 1st stage loading of (ReactOS or GRUB) bootloader. These are totally different things.''<br />
** ''GRUB loading stages are: 1st stage: loading the MBR, 1.5 stage (...), 2nd stage: running modules from grub host filesystem, from (hdX,msdosY)/boot/grub/i386-pc/*.mod''<br />
<br />
==usetup.exe==<br />
bootcd main installer module is a '''usetup.exe''' (@\base\setup\usetup\*)<br />
<br />
usetup.exe is:<br />
* nativecui module<br />
* Uses libraries: zlib, inflib, ext2lib, vfatlib<br />
<br />
==BootOptions of bootcd==<br />
<br />
BootOptions of bootcd are: '/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE'<br />
<pre><br />
// (../../boot/freeldr/freeldr/windows/setupldr.c:219) trace: BootOptions: '/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE'<br />
</pre><br />
Is read by LoadReactOSSetup(): by setup method of ntoskrnl-loader; designed for usetup.exe.<br />
<br />
Specified in: bootcd.ISO\reactos\txtsetup.sif : SetupData/[Dbg]OsLoadOptions :<br />
<pre><br />
{setupldr.c: InfFindFirstLine(InfHandle, "SetupData", "OsLoadOptions", &InfContext)<br />
or {<br />
{setupldr.c: InfFindFirstLine(InfHandle, "SetupData", "DbgOsLoadOptions", &InfContext)<br />
depending of DBG variable (DBG is now defined by default).<br />
</pre><br />
The source file copied to bootcd.ISO is: \boot\bootdata\txtsetup.sif<br />
<pre><br />
...<br />
[SetupData]<br />
DefaultPath = \ReactOS<br />
OsLoadOptions = "/NOGUIBOOT /NODEBUG"<br />
DbgOsLoadOptions = "/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE"<br />
...<br />
</pre><br />
<br />
== bootcd - Blue TextUI MessageBox "Opening hive file failed!" ==<br />
<br />
Blue TextUI MessageBox "Opening hive file failed!" <br />
<br />
Is a symptom of trying to run bootcd as normal reactos installation, with should has registry.<br />
<br />
bootcd hasn't any registry installed. (look for file: %Root%\SYSTEM32\CONFIG\SYSTEM)<br />
<pre><br />
wlregistry.c: UiMessageBox("Opening hive file failed!");<br />
</pre><br />
of /boot/freeldr/freeldr/windows/wlregistry.c<br />
<br />
'''WinLdrLoadSystemHive()/3'''<br />
<pre><br />
BOOLEAN<br />
WinLdrLoadSystemHive(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock,<br />
IN LPCSTR DirectoryPath,<br />
IN LPCSTR HiveName)<br />
/* Concatenate path and filename to get the full name */<br />
strcpy(FullHiveName, DirectoryPath);<br />
strcat(FullHiveName, HiveName);<br />
//Print(L"Loading %s...\n", FullHiveName);<br />
Status = ArcOpen(FullHiveName, OpenReadOnly, &FileId);<br />
<br />
if (Status != ESUCCESS)<br />
{<br />
*** UiMessageBox("Opening hive file failed!");<br />
return FALSE;<br />
}<br />
</pre><br />
'''WinLdrScanSystemHive()''' calls '''WinLdrLoadSystemHive()'''<br />
<pre><br />
BOOLEAN WinLdrScanSystemHive()/2<br />
strcpy(SearchPath, DirectoryPath);<br />
strcat(SearchPath, "SYSTEM32\\CONFIG\\");<br />
Status = WinLdrLoadSystemHive(LoaderBlock, SearchPath, "SYSTEM");<br />
// Fail if failed...<br />
if (!Status) <br />
return FALSE;<br />
</pre><br />
<br />
== How bootcd is built ==<br />
<br />
Quote from \boot\CMakeLists.txt:<br />
<pre><br />
add_custom_target(bootcd<br />
COMMAND native-cdmake -j -m -b ${CMAKE_CURRENT_BINARY_DIR}/freeldr/bootsect/isoboot.bin \<br />
@${CMAKE_CURRENT_BINARY_DIR}/bootcd.lst REACTOS ${REACTOS_BINARY_DIR}/bootcd.iso<br />
DEPENDS native-cdmake<br />
VERBATIM)<br />
</pre><br />
CMAKE_CURRENT_BINARY_DIR = \output-MinGW-i386\reactos\boot<br />
<br />
'''How livecd is built:'''<br />
<br />
Quote from \boot\CMakeLists.txt:<br />
<pre><br />
add_custom_target(livecd<br />
COMMAND native-cdmake -j -m -b ${CMAKE_CURRENT_BINARY_DIR}/freeldr/bootsect/isoboot.bin \<br />
@${CMAKE_CURRENT_BINARY_DIR}/livecd.lst REACTOS ${REACTOS_BINARY_DIR}/livecd.iso<br />
DEPENDS native-cdmake<br />
VERBATIM)<br />
</pre><br />
<br />
'''How isoboot.bin file is built:'''<br />
<pre>CreateBootSectorTarget(isoboot ${CMAKE_CURRENT_SOURCE_DIR}/isoboot.S ${CMAKE_CURRENT_BINARY_DIR}/isoboot.bin 7000)<br />
</pre><br />
<br />
'''freeldr.sys on livecd:'''<br />
freeldr.sys on Livecd is renamed to setupldr.sys because isoboot.bin looks for setupldr.sys<br />
<br />
= ntoskrnl.exe loading and start =<br />
Entry point : _KiSystemStartup@4; subsystem:native</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna./FreeLoader,_bootcd_and_bootrecords&diff=34668User:Mna./FreeLoader, bootcd and bootrecords2014-03-25T11:00:31Z<p>Mna.: /* bootcd and FreeLoader during 1st stage setup */</p>
<hr />
<div>=FreeLoader freeldr Architecture=<br />
<br />
==FreeLoader Initialization==<br />
When FreeLoader gets control it <br />
* saves the boot drive, passed to it in the DL register, partition number passed in the DH register<br />
* sets up the stack, <br />
* enables protected mode, and <br />
* calls BootMain().<br />
--based on quote from \boot\freeldr\notes.txt<br />
<br />
==Freeloader calls hierarchy==<br />
===BootMain===<br />
VOID BootMain(LPSTR CmdLine) is layed in \boot\freeldr\freeldr\freeldr.c<br />
<br />
It is main Freeldr function:<br />
<br />
<pre><br />
VOID BootMain(LPSTR CmdLine)<br />
{<br />
CmdLineParse(CmdLine);<br />
MachInit(CmdLine);<br />
FsInit();<br />
DebugInit();<br />
TRACE("BootMain() called.\n");<br />
<br />
if (!UiInitialize(FALSE))<br />
{<br />
UiMessageBoxCritical("Unable to initialize UI.\n");<br />
goto quit;<br />
}<br />
if (!MmInitializeMemoryManager())<br />
{<br />
UiMessageBoxCritical("Unable to initialize memory manager");<br />
goto quit;<br />
}<br />
#ifdef _M_IX86<br />
HalpInitializePciStubs();<br />
HalpInitBusHandler();<br />
#endif<br />
RunLoader();<br />
<br />
quit:<br />
/* If we reach this point, something went wrong before, therefore reboot */<br />
DiskStopFloppyMotor();<br />
Reboot();<br />
}<br />
</pre><br />
<br />
\boot\freeldr\freeldr\debug.c : DebugInit()<br />
Initializes Rs232 port, among other things.<br />
<br />
===OS_LOADING_METHOD===<br />
'''BootMain'''() calls '''RunLoader'''() //''bootmgr.c''<br />
<br />
'''RunLoader'''() calls '''LoadOperatingSystem'''()<br />
<br />
'''LoadOperatingSystem'''() lookups the OS_LOADING_METHOD and calls found ''loading method''.<br />
<br />
//VOID LoadOperatingSystem(IN OperatingSystemItem* OperatingSystem); //''@\boot\freeldr\freeldr\bootmgr.c''<br />
<br />
OS_LOADING_METHOD is a function pointer field in the table of OSLoadingMethods (in bootmgr.c) :<br />
<pre><br />
typedef VOID (*OS_LOADING_METHOD)(IN OperatingSystemItem* OperatingSystem,<br />
IN USHORT OperatingSystemVersion);<br />
</pre><br />
Most used ''loading methods'' are: LoadAndBootWindows(), LoadReactOSSetup() (@''\boot\freeldr\freeldr\windows\ {winldr.c,setupldr.c}'' )<br />
<br />
* Windows2003/'''LoadAndBootWindows'''() is a normal/default loading method, called by installed ReactOS.<br />
* ReactOSSetup/'''LoadReactOSSetup'''() is a method called by ReactOS bootcd installer ''usetup.exe''.<br />
<br />
List of all ReactOS loading methods:<br />
<pre><br />
{"ReactOSSetup", 0 , LoadReactOSSetup },<br />
#ifdef _M_IX86<br />
{"BootSector" , 0 , LoadAndBootBootSector},<br />
{"Drive" , 0 , LoadAndBootDrive },<br />
{"Partition" , 0 , LoadAndBootPartition },<br />
<br />
{"Linux" , 0 , LoadAndBootLinux },<br />
<br />
{"Windows" , 0 , LoadAndBootWindows },<br />
{"WindowsNT40" , _WIN32_WINNT_NT4 , LoadAndBootWindows },<br />
#endif<br />
{"Windows2003" , _WIN32_WINNT_WS03, LoadAndBootWindows },<br />
</pre><br />
<br />
=== DoOptionsMenu() ===<br />
Options menu is activated by pressing F8 key.<br />
<br />
RunLoader() checks keys and activates; calls DoOptionsMenu() (options.c)<br />
<br />
=Boot records and FreeLoader=<br />
freeldr.sys is started by some type of BootRecord (BR): MBR, VBR, CD boot sector.<br />
<br />
==How bootcd installer usetup.exe writes MBR==<br />
When installing the ReactOS some component should write MBR/VBR to let freeldr.sys start at boot time.<br />
<br />
This is done by usetup.exe : <br />
* BootLoaderHarddiskMbrPage(&Ir) and its helpers: <br />
** InstallMbrBootCodeToDisk()/2 and <br />
** InstallVBRToPartition()/4.<br />
*** InstallFatBootcodeToPartition()/4<br />
<br />
<pre><br />
/** Side note related with bug in usetup.exe -bug writing MBR/VBR in some (frequent) cases: */<br />
<br />
MBRInstallType: usetup.exe variable keeps Boot Record installation mode:<br />
0-None (skip installation) 1-floppy MBR 2-Hdd MBR & VBR <br />
Files:<br />
/base/setup/reactos/ reactos.c : struct SetupData has field MBRInstallType<br />
/base/setup/usetup/interface/ usetup.c : use of MBRInstallType data.<br />
</pre><br />
<br />
'''usetup.exe''' : Page '''''BOOT_LOADER_HARDDISK_MBR_PAGE''''' is handled by: BootLoaderHarddiskMbrPage(&Ir);<br />
( @/base/setup/usetup/interface/usetup.c)<br />
<br />
'''BootLoaderHarddiskMbrPage''' function creates/writes MBR and VBR records.<br />
<br />
''/*** So the main errors are here: This function somehow is not called or the call/subcalls are failed. */''<br />
<br />
<pre><br />
BootLoaderHarddiskMbrPage(&Ir);<br />
/* Step 1: Write the VBR */<br />
InstallVBRToPartition()/4<br />
if (!NT_SUCCESS(Status)) {<br />
MUIDisplayError(ERROR_WRITE_BOOT, Ir, POPUP_WAIT_ENTER);<br />
return QUIT_PAGE;<br />
}<br />
/* Step 2: Write the MBR */<br />
writes bootcd '\loader\dosmbr.bin' into the MBR-place<br />
</pre><br />
<br />
'''InstallVBRToPartition'''/4 (@/base/setup/usetup/bootsup.c)<br />
<pre><br />
InstallVBRToPartition():<br />
if (PartitionType is FAT_PartitionType )<br />
return InstallFatBootcodeToPartition/4<br />
else return STATUS_UNSUCCESSFUL;<br />
</pre><br />
<br />
{| class="wikitable"<br />
|-<br />
! FAT_PartitionType <br />
|-<br />
| PARTITION_FAT_12<br />
|-<br />
| PARTITION_FAT_16<br />
|-<br />
| PARTITION_HUGE<br />
|-<br />
| PARTITION_XINT13<br />
|-<br />
| PARTITION_FAT32<br />
|-<br />
| PARTITION_FAT32_XINT13<br />
|}<br />
<br />
'''InstallFatBootcodeToPartition'''()/4:<br />
<br />
Copies original bootsector file to: %DEST%''\bootsect.ros'' file.<br />
{| class="wikitable"<br />
|-<br />
! FS ID/PartitionType !! Freeloader boot sector binary original name !! Source file name<br />
|-<br />
| FAT32: PARTITION_FAT32, PARTITION_FAT32_XINT13|| fat32.bin || fat32.S<br />
|-<br />
| FAT16: ''else''-branche of ''if''|| fat.bin || fat.S<br />
|-<br />
| otherwise something is failed|| - || -<br />
|}<br />
<br />
'''Legacy''': Also there is a (pretty old,circa 2001) component in ReactOS source: '''''installfreeldr''''' (source: /boot/freeldr/install; binary: unknown). It writes FAT32 MBR only.<br />
<br />
==Boot record types (MBR, VBR, boot sectors, boot records of boot cd/livecd==<br />
TBW: ''InstallFatBootcodeToPartition''-sourced + others (isoboot + ext2(?) etc)<br />
<br />
Parameters boot record passes to FreeLdr: (fat32 & cdrom) (?fat16 doesn't pass DH?)<br />
* boot drive number in DL register. It is BIOS drive number: 0x80 is the 1st drive, 0x81 - 2nd etc.<br />
* boot partition number (0-based) in DH register (0 for CDROM)<br />
<br />
=bootcd during 1st stage setup: FreeLoader, usetup.exe, and boot options=<br />
* ''Note: ReactOS 1st stage setup run by usetup.exe shouldn't be confused with 1st stage loading of (ReactOS or GRUB) bootloader. These are totally different things.''<br />
** ''GRUB loading stages are: 1st stage: loading the MBR, 1.5 stage (...), 2nd stage: running modules from grub host filesystem, from (hdX,msdosY)/boot/grub/i386-pc/*.mod''<br />
<br />
==usetup.exe==<br />
bootcd main installer module is a '''usetup.exe''' (@\base\setup\usetup\*)<br />
<br />
usetup.exe is:<br />
* nativecui module<br />
* Uses libraries: zlib, inflib, ext2lib, vfatlib<br />
<br />
==BootOptions of bootcd==<br />
<br />
BootOptions of bootcd are: '/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE'<br />
<pre><br />
// (../../boot/freeldr/freeldr/windows/setupldr.c:219) trace: BootOptions: '/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE'<br />
</pre><br />
Is read by LoadReactOSSetup(): by setup method of ntoskrnl-loader; designed for usetup.exe.<br />
<br />
Specified in: bootcd.ISO\reactos\txtsetup.sif : SetupData/[Dbg]OsLoadOptions :<br />
<pre><br />
{setupldr.c: InfFindFirstLine(InfHandle, "SetupData", "OsLoadOptions", &InfContext)<br />
or {<br />
{setupldr.c: InfFindFirstLine(InfHandle, "SetupData", "DbgOsLoadOptions", &InfContext)<br />
depending of DBG variable (DBG is now defined by default).<br />
</pre><br />
The source file copied to bootcd.ISO is: \boot\bootdata\txtsetup.sif<br />
<pre><br />
...<br />
[SetupData]<br />
DefaultPath = \ReactOS<br />
OsLoadOptions = "/NOGUIBOOT /NODEBUG"<br />
DbgOsLoadOptions = "/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE"<br />
...<br />
</pre><br />
<br />
== bootcd - Blue TextUI MessageBox "Opening hive file failed!" ==<br />
<br />
Blue TextUI MessageBox "Opening hive file failed!" <br />
<br />
Is a symptom of trying to run bootcd as normal reactos installation, with should has registry.<br />
<br />
bootcd hasn't any registry installed. (look for file: %Root%\SYSTEM32\CONFIG\SYSTEM)<br />
<pre><br />
wlregistry.c: UiMessageBox("Opening hive file failed!");<br />
</pre><br />
of /boot/freeldr/freeldr/windows/wlregistry.c<br />
<br />
'''WinLdrLoadSystemHive()/3'''<br />
<pre><br />
BOOLEAN<br />
WinLdrLoadSystemHive(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock,<br />
IN LPCSTR DirectoryPath,<br />
IN LPCSTR HiveName)<br />
/* Concatenate path and filename to get the full name */<br />
strcpy(FullHiveName, DirectoryPath);<br />
strcat(FullHiveName, HiveName);<br />
//Print(L"Loading %s...\n", FullHiveName);<br />
Status = ArcOpen(FullHiveName, OpenReadOnly, &FileId);<br />
<br />
if (Status != ESUCCESS)<br />
{<br />
*** UiMessageBox("Opening hive file failed!");<br />
return FALSE;<br />
}<br />
</pre><br />
'''WinLdrScanSystemHive()''' calls '''WinLdrLoadSystemHive()'''<br />
<pre><br />
BOOLEAN WinLdrScanSystemHive()/2<br />
strcpy(SearchPath, DirectoryPath);<br />
strcat(SearchPath, "SYSTEM32\\CONFIG\\");<br />
Status = WinLdrLoadSystemHive(LoaderBlock, SearchPath, "SYSTEM");<br />
// Fail if failed...<br />
if (!Status) <br />
return FALSE;<br />
</pre><br />
<br />
== How bootcd is built ==<br />
<br />
Quote from \boot\CMakeLists.txt:<br />
<pre><br />
add_custom_target(bootcd<br />
COMMAND native-cdmake -j -m -b ${CMAKE_CURRENT_BINARY_DIR}/freeldr/bootsect/isoboot.bin \<br />
@${CMAKE_CURRENT_BINARY_DIR}/bootcd.lst REACTOS ${REACTOS_BINARY_DIR}/bootcd.iso<br />
DEPENDS native-cdmake<br />
VERBATIM)<br />
</pre><br />
CMAKE_CURRENT_BINARY_DIR = \output-MinGW-i386\reactos\boot<br />
<br />
'''How livecd is built:'''<br />
<br />
Quote from \boot\CMakeLists.txt:<br />
<pre><br />
add_custom_target(livecd<br />
COMMAND native-cdmake -j -m -b ${CMAKE_CURRENT_BINARY_DIR}/freeldr/bootsect/isoboot.bin \<br />
@${CMAKE_CURRENT_BINARY_DIR}/livecd.lst REACTOS ${REACTOS_BINARY_DIR}/livecd.iso<br />
DEPENDS native-cdmake<br />
VERBATIM)<br />
</pre><br />
<br />
'''How isoboot.bin file is built:'''<br />
<pre>CreateBootSectorTarget(isoboot ${CMAKE_CURRENT_SOURCE_DIR}/isoboot.S ${CMAKE_CURRENT_BINARY_DIR}/isoboot.bin 7000)<br />
</pre><br />
<br />
'''freeldr.sys on livecd:'''<br />
freeldr.sys on Livecd is renamed to setupldr.sys because isoboot.bin looks for setupldr.sys<br />
<br />
= ntoskrnl.exe loading and start =<br />
Entry point : _KiSystemStartup@4; subsystem:native</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna./FreeLoader,_bootcd_and_bootrecords&diff=34667User:Mna./FreeLoader, bootcd and bootrecords2014-03-25T10:57:57Z<p>Mna.: /* FreeLoader loading */</p>
<hr />
<div>=FreeLoader freeldr Architecture=<br />
<br />
==FreeLoader Initialization==<br />
When FreeLoader gets control it <br />
* saves the boot drive, passed to it in the DL register, partition number passed in the DH register<br />
* sets up the stack, <br />
* enables protected mode, and <br />
* calls BootMain().<br />
--based on quote from \boot\freeldr\notes.txt<br />
<br />
==Freeloader calls hierarchy==<br />
===BootMain===<br />
VOID BootMain(LPSTR CmdLine) is layed in \boot\freeldr\freeldr\freeldr.c<br />
<br />
It is main Freeldr function:<br />
<br />
<pre><br />
VOID BootMain(LPSTR CmdLine)<br />
{<br />
CmdLineParse(CmdLine);<br />
MachInit(CmdLine);<br />
FsInit();<br />
DebugInit();<br />
TRACE("BootMain() called.\n");<br />
<br />
if (!UiInitialize(FALSE))<br />
{<br />
UiMessageBoxCritical("Unable to initialize UI.\n");<br />
goto quit;<br />
}<br />
if (!MmInitializeMemoryManager())<br />
{<br />
UiMessageBoxCritical("Unable to initialize memory manager");<br />
goto quit;<br />
}<br />
#ifdef _M_IX86<br />
HalpInitializePciStubs();<br />
HalpInitBusHandler();<br />
#endif<br />
RunLoader();<br />
<br />
quit:<br />
/* If we reach this point, something went wrong before, therefore reboot */<br />
DiskStopFloppyMotor();<br />
Reboot();<br />
}<br />
</pre><br />
<br />
\boot\freeldr\freeldr\debug.c : DebugInit()<br />
Initializes Rs232 port, among other things.<br />
<br />
===OS_LOADING_METHOD===<br />
'''BootMain'''() calls '''RunLoader'''() //''bootmgr.c''<br />
<br />
'''RunLoader'''() calls '''LoadOperatingSystem'''()<br />
<br />
'''LoadOperatingSystem'''() lookups the OS_LOADING_METHOD and calls found ''loading method''.<br />
<br />
//VOID LoadOperatingSystem(IN OperatingSystemItem* OperatingSystem); //''@\boot\freeldr\freeldr\bootmgr.c''<br />
<br />
OS_LOADING_METHOD is a function pointer field in the table of OSLoadingMethods (in bootmgr.c) :<br />
<pre><br />
typedef VOID (*OS_LOADING_METHOD)(IN OperatingSystemItem* OperatingSystem,<br />
IN USHORT OperatingSystemVersion);<br />
</pre><br />
Most used ''loading methods'' are: LoadAndBootWindows(), LoadReactOSSetup() (@''\boot\freeldr\freeldr\windows\ {winldr.c,setupldr.c}'' )<br />
<br />
* Windows2003/'''LoadAndBootWindows'''() is a normal/default loading method, called by installed ReactOS.<br />
* ReactOSSetup/'''LoadReactOSSetup'''() is a method called by ReactOS bootcd installer ''usetup.exe''.<br />
<br />
List of all ReactOS loading methods:<br />
<pre><br />
{"ReactOSSetup", 0 , LoadReactOSSetup },<br />
#ifdef _M_IX86<br />
{"BootSector" , 0 , LoadAndBootBootSector},<br />
{"Drive" , 0 , LoadAndBootDrive },<br />
{"Partition" , 0 , LoadAndBootPartition },<br />
<br />
{"Linux" , 0 , LoadAndBootLinux },<br />
<br />
{"Windows" , 0 , LoadAndBootWindows },<br />
{"WindowsNT40" , _WIN32_WINNT_NT4 , LoadAndBootWindows },<br />
#endif<br />
{"Windows2003" , _WIN32_WINNT_WS03, LoadAndBootWindows },<br />
</pre><br />
<br />
=== DoOptionsMenu() ===<br />
Options menu is activated by pressing F8 key.<br />
<br />
RunLoader() checks keys and activates; calls DoOptionsMenu() (options.c)<br />
<br />
=Boot records and FreeLoader=<br />
freeldr.sys is started by some type of BootRecord (BR): MBR, VBR, CD boot sector.<br />
<br />
==How bootcd installer usetup.exe writes MBR==<br />
When installing the ReactOS some component should write MBR/VBR to let freeldr.sys start at boot time.<br />
<br />
This is done by usetup.exe : <br />
* BootLoaderHarddiskMbrPage(&Ir) and its helpers: <br />
** InstallMbrBootCodeToDisk()/2 and <br />
** InstallVBRToPartition()/4.<br />
*** InstallFatBootcodeToPartition()/4<br />
<br />
<pre><br />
/** Side note related with bug in usetup.exe -bug writing MBR/VBR in some (frequent) cases: */<br />
<br />
MBRInstallType: usetup.exe variable keeps Boot Record installation mode:<br />
0-None (skip installation) 1-floppy MBR 2-Hdd MBR & VBR <br />
Files:<br />
/base/setup/reactos/ reactos.c : struct SetupData has field MBRInstallType<br />
/base/setup/usetup/interface/ usetup.c : use of MBRInstallType data.<br />
</pre><br />
<br />
'''usetup.exe''' : Page '''''BOOT_LOADER_HARDDISK_MBR_PAGE''''' is handled by: BootLoaderHarddiskMbrPage(&Ir);<br />
( @/base/setup/usetup/interface/usetup.c)<br />
<br />
'''BootLoaderHarddiskMbrPage''' function creates/writes MBR and VBR records.<br />
<br />
''/*** So the main errors are here: This function somehow is not called or the call/subcalls are failed. */''<br />
<br />
<pre><br />
BootLoaderHarddiskMbrPage(&Ir);<br />
/* Step 1: Write the VBR */<br />
InstallVBRToPartition()/4<br />
if (!NT_SUCCESS(Status)) {<br />
MUIDisplayError(ERROR_WRITE_BOOT, Ir, POPUP_WAIT_ENTER);<br />
return QUIT_PAGE;<br />
}<br />
/* Step 2: Write the MBR */<br />
writes bootcd '\loader\dosmbr.bin' into the MBR-place<br />
</pre><br />
<br />
'''InstallVBRToPartition'''/4 (@/base/setup/usetup/bootsup.c)<br />
<pre><br />
InstallVBRToPartition():<br />
if (PartitionType is FAT_PartitionType )<br />
return InstallFatBootcodeToPartition/4<br />
else return STATUS_UNSUCCESSFUL;<br />
</pre><br />
<br />
{| class="wikitable"<br />
|-<br />
! FAT_PartitionType <br />
|-<br />
| PARTITION_FAT_12<br />
|-<br />
| PARTITION_FAT_16<br />
|-<br />
| PARTITION_HUGE<br />
|-<br />
| PARTITION_XINT13<br />
|-<br />
| PARTITION_FAT32<br />
|-<br />
| PARTITION_FAT32_XINT13<br />
|}<br />
<br />
'''InstallFatBootcodeToPartition'''()/4:<br />
<br />
Copies original bootsector file to: %DEST%''\bootsect.ros'' file.<br />
{| class="wikitable"<br />
|-<br />
! FS ID/PartitionType !! Freeloader boot sector binary original name !! Source file name<br />
|-<br />
| FAT32: PARTITION_FAT32, PARTITION_FAT32_XINT13|| fat32.bin || fat32.S<br />
|-<br />
| FAT16: ''else''-branche of ''if''|| fat.bin || fat.S<br />
|-<br />
| otherwise something is failed|| - || -<br />
|}<br />
<br />
'''Legacy''': Also there is a (pretty old,circa 2001) component in ReactOS source: '''''installfreeldr''''' (source: /boot/freeldr/install; binary: unknown). It writes FAT32 MBR only.<br />
<br />
==Boot record types (MBR, VBR, boot sectors, boot records of boot cd/livecd==<br />
TBW: ''InstallFatBootcodeToPartition''-sourced + others (isoboot + ext2(?) etc)<br />
<br />
Parameters boot record passes to FreeLdr: (fat32 & cdrom) (?fat16 doesn't pass DH?)<br />
* boot drive number in DL register. It is BIOS drive number: 0x80 is the 1st drive, 0x81 - 2nd etc.<br />
* boot partition number (0-based) in DH register (0 for CDROM)<br />
<br />
=bootcd and FreeLoader during 1st stage setup=<br />
* ''Note: ReactOS 1st stage setup run by usetup.exe shouldn't be confused with 1st stage loading of (ReactOS or GRUB) bootloader. These are totally different things.''<br />
** ''GRUB loading stages are: 1st stage: loading the MBR, 1.5 stage (...), 2nd stage: running modules from grub host filesystem, from (hdX,msdosY)/boot/grub/i386-pc/*.mod''<br />
<br />
==usetup.exe==<br />
bootcd main installer module is a '''usetup.exe''' (@\base\setup\usetup\*)<br />
<br />
usetup.exe is:<br />
* nativecui module<br />
* Uses libraries: zlib, inflib, ext2lib, vfatlib<br />
<br />
==BootOptions of bootcd==<br />
<br />
BootOptions of bootcd are: '/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE'<br />
<pre><br />
// (../../boot/freeldr/freeldr/windows/setupldr.c:219) trace: BootOptions: '/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE'<br />
</pre><br />
Is read by LoadReactOSSetup(): by setup method of ntoskrnl-loader; designed for usetup.exe.<br />
<br />
Specified in: bootcd.ISO\reactos\txtsetup.sif : SetupData/[Dbg]OsLoadOptions :<br />
<pre><br />
{setupldr.c: InfFindFirstLine(InfHandle, "SetupData", "OsLoadOptions", &InfContext)<br />
or {<br />
{setupldr.c: InfFindFirstLine(InfHandle, "SetupData", "DbgOsLoadOptions", &InfContext)<br />
depending of DBG variable (DBG is now defined by default).<br />
</pre><br />
The source file copied to bootcd.ISO is: \boot\bootdata\txtsetup.sif<br />
<pre><br />
...<br />
[SetupData]<br />
DefaultPath = \ReactOS<br />
OsLoadOptions = "/NOGUIBOOT /NODEBUG"<br />
DbgOsLoadOptions = "/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE"<br />
...<br />
</pre><br />
<br />
== bootcd - Blue TextUI MessageBox "Opening hive file failed!" ==<br />
<br />
Blue TextUI MessageBox "Opening hive file failed!" <br />
<br />
Is a symptom of trying to run bootcd as normal reactos installation, with should has registry.<br />
<br />
bootcd hasn't any registry installed. (look for file: %Root%\SYSTEM32\CONFIG\SYSTEM)<br />
<pre><br />
wlregistry.c: UiMessageBox("Opening hive file failed!");<br />
</pre><br />
of /boot/freeldr/freeldr/windows/wlregistry.c<br />
<br />
'''WinLdrLoadSystemHive()/3'''<br />
<pre><br />
BOOLEAN<br />
WinLdrLoadSystemHive(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock,<br />
IN LPCSTR DirectoryPath,<br />
IN LPCSTR HiveName)<br />
/* Concatenate path and filename to get the full name */<br />
strcpy(FullHiveName, DirectoryPath);<br />
strcat(FullHiveName, HiveName);<br />
//Print(L"Loading %s...\n", FullHiveName);<br />
Status = ArcOpen(FullHiveName, OpenReadOnly, &FileId);<br />
<br />
if (Status != ESUCCESS)<br />
{<br />
*** UiMessageBox("Opening hive file failed!");<br />
return FALSE;<br />
}<br />
</pre><br />
'''WinLdrScanSystemHive()''' calls '''WinLdrLoadSystemHive()'''<br />
<pre><br />
BOOLEAN WinLdrScanSystemHive()/2<br />
strcpy(SearchPath, DirectoryPath);<br />
strcat(SearchPath, "SYSTEM32\\CONFIG\\");<br />
Status = WinLdrLoadSystemHive(LoaderBlock, SearchPath, "SYSTEM");<br />
// Fail if failed...<br />
if (!Status) <br />
return FALSE;<br />
</pre><br />
<br />
== How bootcd is built ==<br />
<br />
Quote from \boot\CMakeLists.txt:<br />
<pre><br />
add_custom_target(bootcd<br />
COMMAND native-cdmake -j -m -b ${CMAKE_CURRENT_BINARY_DIR}/freeldr/bootsect/isoboot.bin \<br />
@${CMAKE_CURRENT_BINARY_DIR}/bootcd.lst REACTOS ${REACTOS_BINARY_DIR}/bootcd.iso<br />
DEPENDS native-cdmake<br />
VERBATIM)<br />
</pre><br />
CMAKE_CURRENT_BINARY_DIR = \output-MinGW-i386\reactos\boot<br />
<br />
'''How livecd is built:'''<br />
<br />
Quote from \boot\CMakeLists.txt:<br />
<pre><br />
add_custom_target(livecd<br />
COMMAND native-cdmake -j -m -b ${CMAKE_CURRENT_BINARY_DIR}/freeldr/bootsect/isoboot.bin \<br />
@${CMAKE_CURRENT_BINARY_DIR}/livecd.lst REACTOS ${REACTOS_BINARY_DIR}/livecd.iso<br />
DEPENDS native-cdmake<br />
VERBATIM)<br />
</pre><br />
<br />
'''How isoboot.bin file is built:'''<br />
<pre>CreateBootSectorTarget(isoboot ${CMAKE_CURRENT_SOURCE_DIR}/isoboot.S ${CMAKE_CURRENT_BINARY_DIR}/isoboot.bin 7000)<br />
</pre><br />
<br />
'''freeldr.sys on livecd:'''<br />
freeldr.sys on Livecd is renamed to setupldr.sys because isoboot.bin looks for setupldr.sys<br />
<br />
= ntoskrnl.exe loading and start =<br />
Entry point : _KiSystemStartup@4; subsystem:native</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna./FreeLoader,_bootcd_and_bootrecords&diff=34666User:Mna./FreeLoader, bootcd and bootrecords2014-03-25T10:51:20Z<p>Mna.: /* OS_LOADING_METHOD */</p>
<hr />
<div>=FreeLoader freeldr Architecture=<br />
<br />
==FreeLoader Initialization==<br />
When FreeLoader gets control it <br />
* saves the boot drive, passed to it in the DL register, partition number passed in the DH register<br />
* sets up the stack, <br />
* enables protected mode, and <br />
* calls BootMain().<br />
--based on quote from \boot\freeldr\notes.txt<br />
<br />
==Freeloader calls hierarchy==<br />
===BootMain===<br />
VOID BootMain(LPSTR CmdLine) is layed in \boot\freeldr\freeldr\freeldr.c<br />
<br />
It is main Freeldr function:<br />
<br />
<pre><br />
VOID BootMain(LPSTR CmdLine)<br />
{<br />
CmdLineParse(CmdLine);<br />
MachInit(CmdLine);<br />
FsInit();<br />
DebugInit();<br />
TRACE("BootMain() called.\n");<br />
<br />
if (!UiInitialize(FALSE))<br />
{<br />
UiMessageBoxCritical("Unable to initialize UI.\n");<br />
goto quit;<br />
}<br />
if (!MmInitializeMemoryManager())<br />
{<br />
UiMessageBoxCritical("Unable to initialize memory manager");<br />
goto quit;<br />
}<br />
#ifdef _M_IX86<br />
HalpInitializePciStubs();<br />
HalpInitBusHandler();<br />
#endif<br />
RunLoader();<br />
<br />
quit:<br />
/* If we reach this point, something went wrong before, therefore reboot */<br />
DiskStopFloppyMotor();<br />
Reboot();<br />
}<br />
</pre><br />
<br />
\boot\freeldr\freeldr\debug.c : DebugInit()<br />
Initializes Rs232 port, among other things.<br />
<br />
===OS_LOADING_METHOD===<br />
'''BootMain'''() calls '''RunLoader'''() //''bootmgr.c''<br />
<br />
'''RunLoader'''() calls '''LoadOperatingSystem'''()<br />
<br />
'''LoadOperatingSystem'''() lookups the OS_LOADING_METHOD and calls found ''loading method''.<br />
<br />
//VOID LoadOperatingSystem(IN OperatingSystemItem* OperatingSystem); //''@\boot\freeldr\freeldr\bootmgr.c''<br />
<br />
OS_LOADING_METHOD is a function pointer field in the table of OSLoadingMethods (in bootmgr.c) :<br />
<pre><br />
typedef VOID (*OS_LOADING_METHOD)(IN OperatingSystemItem* OperatingSystem,<br />
IN USHORT OperatingSystemVersion);<br />
</pre><br />
Most used ''loading methods'' are: LoadAndBootWindows(), LoadReactOSSetup() (@''\boot\freeldr\freeldr\windows\ {winldr.c,setupldr.c}'' )<br />
<br />
* Windows2003/'''LoadAndBootWindows'''() is a normal/default loading method, called by installed ReactOS.<br />
* ReactOSSetup/'''LoadReactOSSetup'''() is a method called by ReactOS bootcd installer ''usetup.exe''.<br />
<br />
List of all ReactOS loading methods:<br />
<pre><br />
{"ReactOSSetup", 0 , LoadReactOSSetup },<br />
#ifdef _M_IX86<br />
{"BootSector" , 0 , LoadAndBootBootSector},<br />
{"Drive" , 0 , LoadAndBootDrive },<br />
{"Partition" , 0 , LoadAndBootPartition },<br />
<br />
{"Linux" , 0 , LoadAndBootLinux },<br />
<br />
{"Windows" , 0 , LoadAndBootWindows },<br />
{"WindowsNT40" , _WIN32_WINNT_NT4 , LoadAndBootWindows },<br />
#endif<br />
{"Windows2003" , _WIN32_WINNT_WS03, LoadAndBootWindows },<br />
</pre><br />
<br />
=== DoOptionsMenu() ===<br />
Options menu is activated by pressing F8 key.<br />
<br />
RunLoader() checks keys and activates; calls DoOptionsMenu() (options.c)<br />
<br />
=FreeLoader loading=<br />
freeldr.sys is started by some type of BootRecord (BR): MBR, VBR, CD boot sector.<br />
<br />
==How bootcd installer usetup.exe writes MBR==<br />
When installing the ReactOS some component should write MBR/VBR to let freeldr.sys start at boot time.<br />
<br />
This is done by usetup.exe : <br />
* BootLoaderHarddiskMbrPage(&Ir) and its helpers: <br />
** InstallMbrBootCodeToDisk()/2 and <br />
** InstallVBRToPartition()/4.<br />
*** InstallFatBootcodeToPartition()/4<br />
<br />
<pre><br />
/** Side note related with bug in usetup.exe -bug writing MBR/VBR in some (frequent) cases: */<br />
<br />
MBRInstallType: usetup.exe variable keeps Boot Record installation mode:<br />
0-None (skip installation) 1-floppy MBR 2-Hdd MBR & VBR <br />
Files:<br />
/base/setup/reactos/ reactos.c : struct SetupData has field MBRInstallType<br />
/base/setup/usetup/interface/ usetup.c : use of MBRInstallType data.<br />
</pre><br />
<br />
'''usetup.exe''' : Page '''''BOOT_LOADER_HARDDISK_MBR_PAGE''''' is handled by: BootLoaderHarddiskMbrPage(&Ir);<br />
( @/base/setup/usetup/interface/usetup.c)<br />
<br />
'''BootLoaderHarddiskMbrPage''' function creates/writes MBR and VBR records.<br />
<br />
''/*** So the main errors are here: This function somehow is not called or the call/subcalls are failed. */''<br />
<br />
<pre><br />
BootLoaderHarddiskMbrPage(&Ir);<br />
/* Step 1: Write the VBR */<br />
InstallVBRToPartition()/4<br />
if (!NT_SUCCESS(Status)) {<br />
MUIDisplayError(ERROR_WRITE_BOOT, Ir, POPUP_WAIT_ENTER);<br />
return QUIT_PAGE;<br />
}<br />
/* Step 2: Write the MBR */<br />
writes bootcd '\loader\dosmbr.bin' into the MBR-place<br />
</pre><br />
<br />
'''InstallVBRToPartition'''/4 (@/base/setup/usetup/bootsup.c)<br />
<pre><br />
InstallVBRToPartition():<br />
if (PartitionType is FAT_PartitionType )<br />
return InstallFatBootcodeToPartition/4<br />
else return STATUS_UNSUCCESSFUL;<br />
</pre><br />
<br />
{| class="wikitable"<br />
|-<br />
! FAT_PartitionType <br />
|-<br />
| PARTITION_FAT_12<br />
|-<br />
| PARTITION_FAT_16<br />
|-<br />
| PARTITION_HUGE<br />
|-<br />
| PARTITION_XINT13<br />
|-<br />
| PARTITION_FAT32<br />
|-<br />
| PARTITION_FAT32_XINT13<br />
|}<br />
<br />
'''InstallFatBootcodeToPartition'''()/4:<br />
<br />
Copies original bootsector file to: %DEST%''\bootsect.ros'' file.<br />
{| class="wikitable"<br />
|-<br />
! FS ID/PartitionType !! Freeloader boot sector binary original name !! Source file name<br />
|-<br />
| FAT32: PARTITION_FAT32, PARTITION_FAT32_XINT13|| fat32.bin || fat32.S<br />
|-<br />
| FAT16: ''else''-branche of ''if''|| fat.bin || fat.S<br />
|-<br />
| otherwise something is failed|| - || -<br />
|}<br />
<br />
'''Legacy''': Also there is a (pretty old,circa 2001) component in ReactOS source: '''''installfreeldr''''' (source: /boot/freeldr/install; binary: unknown). It writes FAT32 MBR only.<br />
<br />
==Boot record types (MBR, VBR, boot sectors, boot records of boot cd/livecd==<br />
TBW: ''InstallFatBootcodeToPartition''-sourced + others (isoboot + ext2(?) etc)<br />
<br />
Parameters boot record passes to FreeLdr: (fat32 & cdrom) (?fat16 doesn't pass DH?)<br />
* boot drive number in DL register. It is BIOS drive number: 0x80 is the 1st drive, 0x81 - 2nd etc.<br />
* boot partition number (0-based) in DH register (0 for CDROM)<br />
<br />
=bootcd and FreeLoader during 1st stage setup=<br />
* ''Note: ReactOS 1st stage setup run by usetup.exe shouldn't be confused with 1st stage loading of (ReactOS or GRUB) bootloader. These are totally different things.''<br />
** ''GRUB loading stages are: 1st stage: loading the MBR, 1.5 stage (...), 2nd stage: running modules from grub host filesystem, from (hdX,msdosY)/boot/grub/i386-pc/*.mod''<br />
<br />
==usetup.exe==<br />
bootcd main installer module is a '''usetup.exe''' (@\base\setup\usetup\*)<br />
<br />
usetup.exe is:<br />
* nativecui module<br />
* Uses libraries: zlib, inflib, ext2lib, vfatlib<br />
<br />
==BootOptions of bootcd==<br />
<br />
BootOptions of bootcd are: '/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE'<br />
<pre><br />
// (../../boot/freeldr/freeldr/windows/setupldr.c:219) trace: BootOptions: '/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE'<br />
</pre><br />
Is read by LoadReactOSSetup(): by setup method of ntoskrnl-loader; designed for usetup.exe.<br />
<br />
Specified in: bootcd.ISO\reactos\txtsetup.sif : SetupData/[Dbg]OsLoadOptions :<br />
<pre><br />
{setupldr.c: InfFindFirstLine(InfHandle, "SetupData", "OsLoadOptions", &InfContext)<br />
or {<br />
{setupldr.c: InfFindFirstLine(InfHandle, "SetupData", "DbgOsLoadOptions", &InfContext)<br />
depending of DBG variable (DBG is now defined by default).<br />
</pre><br />
The source file copied to bootcd.ISO is: \boot\bootdata\txtsetup.sif<br />
<pre><br />
...<br />
[SetupData]<br />
DefaultPath = \ReactOS<br />
OsLoadOptions = "/NOGUIBOOT /NODEBUG"<br />
DbgOsLoadOptions = "/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE"<br />
...<br />
</pre><br />
<br />
== bootcd - Blue TextUI MessageBox "Opening hive file failed!" ==<br />
<br />
Blue TextUI MessageBox "Opening hive file failed!" <br />
<br />
Is a symptom of trying to run bootcd as normal reactos installation, with should has registry.<br />
<br />
bootcd hasn't any registry installed. (look for file: %Root%\SYSTEM32\CONFIG\SYSTEM)<br />
<pre><br />
wlregistry.c: UiMessageBox("Opening hive file failed!");<br />
</pre><br />
of /boot/freeldr/freeldr/windows/wlregistry.c<br />
<br />
'''WinLdrLoadSystemHive()/3'''<br />
<pre><br />
BOOLEAN<br />
WinLdrLoadSystemHive(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock,<br />
IN LPCSTR DirectoryPath,<br />
IN LPCSTR HiveName)<br />
/* Concatenate path and filename to get the full name */<br />
strcpy(FullHiveName, DirectoryPath);<br />
strcat(FullHiveName, HiveName);<br />
//Print(L"Loading %s...\n", FullHiveName);<br />
Status = ArcOpen(FullHiveName, OpenReadOnly, &FileId);<br />
<br />
if (Status != ESUCCESS)<br />
{<br />
*** UiMessageBox("Opening hive file failed!");<br />
return FALSE;<br />
}<br />
</pre><br />
'''WinLdrScanSystemHive()''' calls '''WinLdrLoadSystemHive()'''<br />
<pre><br />
BOOLEAN WinLdrScanSystemHive()/2<br />
strcpy(SearchPath, DirectoryPath);<br />
strcat(SearchPath, "SYSTEM32\\CONFIG\\");<br />
Status = WinLdrLoadSystemHive(LoaderBlock, SearchPath, "SYSTEM");<br />
// Fail if failed...<br />
if (!Status) <br />
return FALSE;<br />
</pre><br />
<br />
== How bootcd is built ==<br />
<br />
Quote from \boot\CMakeLists.txt:<br />
<pre><br />
add_custom_target(bootcd<br />
COMMAND native-cdmake -j -m -b ${CMAKE_CURRENT_BINARY_DIR}/freeldr/bootsect/isoboot.bin \<br />
@${CMAKE_CURRENT_BINARY_DIR}/bootcd.lst REACTOS ${REACTOS_BINARY_DIR}/bootcd.iso<br />
DEPENDS native-cdmake<br />
VERBATIM)<br />
</pre><br />
CMAKE_CURRENT_BINARY_DIR = \output-MinGW-i386\reactos\boot<br />
<br />
'''How livecd is built:'''<br />
<br />
Quote from \boot\CMakeLists.txt:<br />
<pre><br />
add_custom_target(livecd<br />
COMMAND native-cdmake -j -m -b ${CMAKE_CURRENT_BINARY_DIR}/freeldr/bootsect/isoboot.bin \<br />
@${CMAKE_CURRENT_BINARY_DIR}/livecd.lst REACTOS ${REACTOS_BINARY_DIR}/livecd.iso<br />
DEPENDS native-cdmake<br />
VERBATIM)<br />
</pre><br />
<br />
'''How isoboot.bin file is built:'''<br />
<pre>CreateBootSectorTarget(isoboot ${CMAKE_CURRENT_SOURCE_DIR}/isoboot.S ${CMAKE_CURRENT_BINARY_DIR}/isoboot.bin 7000)<br />
</pre><br />
<br />
'''freeldr.sys on livecd:'''<br />
freeldr.sys on Livecd is renamed to setupldr.sys because isoboot.bin looks for setupldr.sys<br />
<br />
= ntoskrnl.exe loading and start =<br />
Entry point : _KiSystemStartup@4; subsystem:native</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna./FreeLoader,_bootcd_and_bootrecords&diff=34665User:Mna./FreeLoader, bootcd and bootrecords2014-03-25T10:49:38Z<p>Mna.: /* OS_LOADING_METHOD */</p>
<hr />
<div>=FreeLoader freeldr Architecture=<br />
<br />
==FreeLoader Initialization==<br />
When FreeLoader gets control it <br />
* saves the boot drive, passed to it in the DL register, partition number passed in the DH register<br />
* sets up the stack, <br />
* enables protected mode, and <br />
* calls BootMain().<br />
--based on quote from \boot\freeldr\notes.txt<br />
<br />
==Freeloader calls hierarchy==<br />
===BootMain===<br />
VOID BootMain(LPSTR CmdLine) is layed in \boot\freeldr\freeldr\freeldr.c<br />
<br />
It is main Freeldr function:<br />
<br />
<pre><br />
VOID BootMain(LPSTR CmdLine)<br />
{<br />
CmdLineParse(CmdLine);<br />
MachInit(CmdLine);<br />
FsInit();<br />
DebugInit();<br />
TRACE("BootMain() called.\n");<br />
<br />
if (!UiInitialize(FALSE))<br />
{<br />
UiMessageBoxCritical("Unable to initialize UI.\n");<br />
goto quit;<br />
}<br />
if (!MmInitializeMemoryManager())<br />
{<br />
UiMessageBoxCritical("Unable to initialize memory manager");<br />
goto quit;<br />
}<br />
#ifdef _M_IX86<br />
HalpInitializePciStubs();<br />
HalpInitBusHandler();<br />
#endif<br />
RunLoader();<br />
<br />
quit:<br />
/* If we reach this point, something went wrong before, therefore reboot */<br />
DiskStopFloppyMotor();<br />
Reboot();<br />
}<br />
</pre><br />
<br />
\boot\freeldr\freeldr\debug.c : DebugInit()<br />
Initializes Rs232 port, among other things.<br />
<br />
===OS_LOADING_METHOD===<br />
'''BootMain'''() calls '''RunLoader'''() //bootmgr.c<br />
<br />
'''RunLoader'''() calls '''LoadOperatingSystem'''()<br />
<br />
'''LoadOperatingSystem'''() lookups the OS_LOADING_METHOD and calls found loading method.<br />
<br />
//VOID LoadOperatingSystem(IN OperatingSystemItem* OperatingSystem); //@\boot\freeldr\freeldr\bootmgr.c<br />
<br />
OS_LOADING_METHOD is a function pointer field in the table of OSLoadingMethods (in bootmgr.c) :<br />
<pre><br />
typedef VOID (*OS_LOADING_METHOD)(IN OperatingSystemItem* OperatingSystem,<br />
IN USHORT OperatingSystemVersion);<br />
</pre><br />
Most used ''loading methods'' are: '''LoadAndBootWindows'''(), '''LoadReactOSSetup'''() (@\boot\freeldr\freeldr\windows\ {winldr.c,setupldr.c} )<br />
<br />
Windows2003/LoadAndBootWindows() is a normal/default loading method, called by installed ReactOS.<br />
ReactOSSetup/LoadReactOSSetup() is a method called by ReactOS bootcd installer ''usetup.exe''.<br />
<br />
List of all ReactOS loading methods:<br />
<pre><br />
{"ReactOSSetup", 0 , LoadReactOSSetup },<br />
#ifdef _M_IX86<br />
{"BootSector" , 0 , LoadAndBootBootSector},<br />
{"Drive" , 0 , LoadAndBootDrive },<br />
{"Partition" , 0 , LoadAndBootPartition },<br />
<br />
{"Linux" , 0 , LoadAndBootLinux },<br />
<br />
{"Windows" , 0 , LoadAndBootWindows },<br />
{"WindowsNT40" , _WIN32_WINNT_NT4 , LoadAndBootWindows },<br />
#endif<br />
{"Windows2003" , _WIN32_WINNT_WS03, LoadAndBootWindows },<br />
</pre><br />
<br />
=== DoOptionsMenu() ===<br />
Options menu is activated by pressing F8 key.<br />
<br />
RunLoader() checks keys and activates; calls DoOptionsMenu() (options.c)<br />
<br />
=FreeLoader loading=<br />
freeldr.sys is started by some type of BootRecord (BR): MBR, VBR, CD boot sector.<br />
<br />
==How bootcd installer usetup.exe writes MBR==<br />
When installing the ReactOS some component should write MBR/VBR to let freeldr.sys start at boot time.<br />
<br />
This is done by usetup.exe : <br />
* BootLoaderHarddiskMbrPage(&Ir) and its helpers: <br />
** InstallMbrBootCodeToDisk()/2 and <br />
** InstallVBRToPartition()/4.<br />
*** InstallFatBootcodeToPartition()/4<br />
<br />
<pre><br />
/** Side note related with bug in usetup.exe -bug writing MBR/VBR in some (frequent) cases: */<br />
<br />
MBRInstallType: usetup.exe variable keeps Boot Record installation mode:<br />
0-None (skip installation) 1-floppy MBR 2-Hdd MBR & VBR <br />
Files:<br />
/base/setup/reactos/ reactos.c : struct SetupData has field MBRInstallType<br />
/base/setup/usetup/interface/ usetup.c : use of MBRInstallType data.<br />
</pre><br />
<br />
'''usetup.exe''' : Page '''''BOOT_LOADER_HARDDISK_MBR_PAGE''''' is handled by: BootLoaderHarddiskMbrPage(&Ir);<br />
( @/base/setup/usetup/interface/usetup.c)<br />
<br />
'''BootLoaderHarddiskMbrPage''' function creates/writes MBR and VBR records.<br />
<br />
''/*** So the main errors are here: This function somehow is not called or the call/subcalls are failed. */''<br />
<br />
<pre><br />
BootLoaderHarddiskMbrPage(&Ir);<br />
/* Step 1: Write the VBR */<br />
InstallVBRToPartition()/4<br />
if (!NT_SUCCESS(Status)) {<br />
MUIDisplayError(ERROR_WRITE_BOOT, Ir, POPUP_WAIT_ENTER);<br />
return QUIT_PAGE;<br />
}<br />
/* Step 2: Write the MBR */<br />
writes bootcd '\loader\dosmbr.bin' into the MBR-place<br />
</pre><br />
<br />
'''InstallVBRToPartition'''/4 (@/base/setup/usetup/bootsup.c)<br />
<pre><br />
InstallVBRToPartition():<br />
if (PartitionType is FAT_PartitionType )<br />
return InstallFatBootcodeToPartition/4<br />
else return STATUS_UNSUCCESSFUL;<br />
</pre><br />
<br />
{| class="wikitable"<br />
|-<br />
! FAT_PartitionType <br />
|-<br />
| PARTITION_FAT_12<br />
|-<br />
| PARTITION_FAT_16<br />
|-<br />
| PARTITION_HUGE<br />
|-<br />
| PARTITION_XINT13<br />
|-<br />
| PARTITION_FAT32<br />
|-<br />
| PARTITION_FAT32_XINT13<br />
|}<br />
<br />
'''InstallFatBootcodeToPartition'''()/4:<br />
<br />
Copies original bootsector file to: %DEST%''\bootsect.ros'' file.<br />
{| class="wikitable"<br />
|-<br />
! FS ID/PartitionType !! Freeloader boot sector binary original name !! Source file name<br />
|-<br />
| FAT32: PARTITION_FAT32, PARTITION_FAT32_XINT13|| fat32.bin || fat32.S<br />
|-<br />
| FAT16: ''else''-branche of ''if''|| fat.bin || fat.S<br />
|-<br />
| otherwise something is failed|| - || -<br />
|}<br />
<br />
'''Legacy''': Also there is a (pretty old,circa 2001) component in ReactOS source: '''''installfreeldr''''' (source: /boot/freeldr/install; binary: unknown). It writes FAT32 MBR only.<br />
<br />
==Boot record types (MBR, VBR, boot sectors, boot records of boot cd/livecd==<br />
TBW: ''InstallFatBootcodeToPartition''-sourced + others (isoboot + ext2(?) etc)<br />
<br />
Parameters boot record passes to FreeLdr: (fat32 & cdrom) (?fat16 doesn't pass DH?)<br />
* boot drive number in DL register. It is BIOS drive number: 0x80 is the 1st drive, 0x81 - 2nd etc.<br />
* boot partition number (0-based) in DH register (0 for CDROM)<br />
<br />
=bootcd and FreeLoader during 1st stage setup=<br />
* ''Note: ReactOS 1st stage setup run by usetup.exe shouldn't be confused with 1st stage loading of (ReactOS or GRUB) bootloader. These are totally different things.''<br />
** ''GRUB loading stages are: 1st stage: loading the MBR, 1.5 stage (...), 2nd stage: running modules from grub host filesystem, from (hdX,msdosY)/boot/grub/i386-pc/*.mod''<br />
<br />
==usetup.exe==<br />
bootcd main installer module is a '''usetup.exe''' (@\base\setup\usetup\*)<br />
<br />
usetup.exe is:<br />
* nativecui module<br />
* Uses libraries: zlib, inflib, ext2lib, vfatlib<br />
<br />
==BootOptions of bootcd==<br />
<br />
BootOptions of bootcd are: '/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE'<br />
<pre><br />
// (../../boot/freeldr/freeldr/windows/setupldr.c:219) trace: BootOptions: '/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE'<br />
</pre><br />
Is read by LoadReactOSSetup(): by setup method of ntoskrnl-loader; designed for usetup.exe.<br />
<br />
Specified in: bootcd.ISO\reactos\txtsetup.sif : SetupData/[Dbg]OsLoadOptions :<br />
<pre><br />
{setupldr.c: InfFindFirstLine(InfHandle, "SetupData", "OsLoadOptions", &InfContext)<br />
or {<br />
{setupldr.c: InfFindFirstLine(InfHandle, "SetupData", "DbgOsLoadOptions", &InfContext)<br />
depending of DBG variable (DBG is now defined by default).<br />
</pre><br />
The source file copied to bootcd.ISO is: \boot\bootdata\txtsetup.sif<br />
<pre><br />
...<br />
[SetupData]<br />
DefaultPath = \ReactOS<br />
OsLoadOptions = "/NOGUIBOOT /NODEBUG"<br />
DbgOsLoadOptions = "/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE"<br />
...<br />
</pre><br />
<br />
== bootcd - Blue TextUI MessageBox "Opening hive file failed!" ==<br />
<br />
Blue TextUI MessageBox "Opening hive file failed!" <br />
<br />
Is a symptom of trying to run bootcd as normal reactos installation, with should has registry.<br />
<br />
bootcd hasn't any registry installed. (look for file: %Root%\SYSTEM32\CONFIG\SYSTEM)<br />
<pre><br />
wlregistry.c: UiMessageBox("Opening hive file failed!");<br />
</pre><br />
of /boot/freeldr/freeldr/windows/wlregistry.c<br />
<br />
'''WinLdrLoadSystemHive()/3'''<br />
<pre><br />
BOOLEAN<br />
WinLdrLoadSystemHive(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock,<br />
IN LPCSTR DirectoryPath,<br />
IN LPCSTR HiveName)<br />
/* Concatenate path and filename to get the full name */<br />
strcpy(FullHiveName, DirectoryPath);<br />
strcat(FullHiveName, HiveName);<br />
//Print(L"Loading %s...\n", FullHiveName);<br />
Status = ArcOpen(FullHiveName, OpenReadOnly, &FileId);<br />
<br />
if (Status != ESUCCESS)<br />
{<br />
*** UiMessageBox("Opening hive file failed!");<br />
return FALSE;<br />
}<br />
</pre><br />
'''WinLdrScanSystemHive()''' calls '''WinLdrLoadSystemHive()'''<br />
<pre><br />
BOOLEAN WinLdrScanSystemHive()/2<br />
strcpy(SearchPath, DirectoryPath);<br />
strcat(SearchPath, "SYSTEM32\\CONFIG\\");<br />
Status = WinLdrLoadSystemHive(LoaderBlock, SearchPath, "SYSTEM");<br />
// Fail if failed...<br />
if (!Status) <br />
return FALSE;<br />
</pre><br />
<br />
== How bootcd is built ==<br />
<br />
Quote from \boot\CMakeLists.txt:<br />
<pre><br />
add_custom_target(bootcd<br />
COMMAND native-cdmake -j -m -b ${CMAKE_CURRENT_BINARY_DIR}/freeldr/bootsect/isoboot.bin \<br />
@${CMAKE_CURRENT_BINARY_DIR}/bootcd.lst REACTOS ${REACTOS_BINARY_DIR}/bootcd.iso<br />
DEPENDS native-cdmake<br />
VERBATIM)<br />
</pre><br />
CMAKE_CURRENT_BINARY_DIR = \output-MinGW-i386\reactos\boot<br />
<br />
'''How livecd is built:'''<br />
<br />
Quote from \boot\CMakeLists.txt:<br />
<pre><br />
add_custom_target(livecd<br />
COMMAND native-cdmake -j -m -b ${CMAKE_CURRENT_BINARY_DIR}/freeldr/bootsect/isoboot.bin \<br />
@${CMAKE_CURRENT_BINARY_DIR}/livecd.lst REACTOS ${REACTOS_BINARY_DIR}/livecd.iso<br />
DEPENDS native-cdmake<br />
VERBATIM)<br />
</pre><br />
<br />
'''How isoboot.bin file is built:'''<br />
<pre>CreateBootSectorTarget(isoboot ${CMAKE_CURRENT_SOURCE_DIR}/isoboot.S ${CMAKE_CURRENT_BINARY_DIR}/isoboot.bin 7000)<br />
</pre><br />
<br />
'''freeldr.sys on livecd:'''<br />
freeldr.sys on Livecd is renamed to setupldr.sys because isoboot.bin looks for setupldr.sys<br />
<br />
= ntoskrnl.exe loading and start =<br />
Entry point : _KiSystemStartup@4; subsystem:native</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna./FreeLoader,_bootcd_and_bootrecords&diff=34664User:Mna./FreeLoader, bootcd and bootrecords2014-03-25T10:46:25Z<p>Mna.: /* FreeLoader freeldr Architecture */</p>
<hr />
<div>=FreeLoader freeldr Architecture=<br />
<br />
==FreeLoader Initialization==<br />
When FreeLoader gets control it <br />
* saves the boot drive, passed to it in the DL register, partition number passed in the DH register<br />
* sets up the stack, <br />
* enables protected mode, and <br />
* calls BootMain().<br />
--based on quote from \boot\freeldr\notes.txt<br />
<br />
==Freeloader calls hierarchy==<br />
===BootMain===<br />
VOID BootMain(LPSTR CmdLine) is layed in \boot\freeldr\freeldr\freeldr.c<br />
<br />
It is main Freeldr function:<br />
<br />
<pre><br />
VOID BootMain(LPSTR CmdLine)<br />
{<br />
CmdLineParse(CmdLine);<br />
MachInit(CmdLine);<br />
FsInit();<br />
DebugInit();<br />
TRACE("BootMain() called.\n");<br />
<br />
if (!UiInitialize(FALSE))<br />
{<br />
UiMessageBoxCritical("Unable to initialize UI.\n");<br />
goto quit;<br />
}<br />
if (!MmInitializeMemoryManager())<br />
{<br />
UiMessageBoxCritical("Unable to initialize memory manager");<br />
goto quit;<br />
}<br />
#ifdef _M_IX86<br />
HalpInitializePciStubs();<br />
HalpInitBusHandler();<br />
#endif<br />
RunLoader();<br />
<br />
quit:<br />
/* If we reach this point, something went wrong before, therefore reboot */<br />
DiskStopFloppyMotor();<br />
Reboot();<br />
}<br />
</pre><br />
<br />
\boot\freeldr\freeldr\debug.c : DebugInit()<br />
Initializes Rs232 port, among other things.<br />
<br />
===OS_LOADING_METHOD===<br />
'''BootMain'''() calls '''RunLoader'''() //bootmgr.c<br />
<br />
'''RunLoader'''() calls '''LoadOperatingSystem'''()<br />
<br />
'''LoadOperatingSystem'''() lookups the OS_LOADING_METHOD and calls found loading method.<br />
//\boot\freeldr\freeldr\bootmgr.c<br />
//VOID LoadOperatingSystem(IN OperatingSystemItem* OperatingSystem);<br />
<br />
OS_LOADING_METHOD is a function pointer field in the table of OSLoadingMethods (in bootmgr.c) :<br />
<pre><br />
typedef VOID (*OS_LOADING_METHOD)(IN OperatingSystemItem* OperatingSystem,<br />
IN USHORT OperatingSystemVersion);<br />
</pre><br />
Most used loading methods are: '''LoadAndBootWindows'''(), '''LoadReactOSSetup'''()<br />
// \boot\freeldr\freeldr\windows\ {winldr.c,setupldr.c}<br />
<br />
Windows2003/LoadAndBootWindows() is a normal/default loading method, called by installed ReactOS.<br />
ReactOSSetup/LoadReactOSSetup() is a method called by ReactOS bootcd installer ''usetup.exe''.<br />
<br />
List of all ReactOS loading methods:<br />
<pre><br />
{"ReactOSSetup", 0 , LoadReactOSSetup },<br />
#ifdef _M_IX86<br />
{"BootSector" , 0 , LoadAndBootBootSector},<br />
{"Drive" , 0 , LoadAndBootDrive },<br />
{"Partition" , 0 , LoadAndBootPartition },<br />
<br />
{"Linux" , 0 , LoadAndBootLinux },<br />
<br />
{"Windows" , 0 , LoadAndBootWindows },<br />
{"WindowsNT40" , _WIN32_WINNT_NT4 , LoadAndBootWindows },<br />
#endif<br />
{"Windows2003" , _WIN32_WINNT_WS03, LoadAndBootWindows },<br />
</pre><br />
<br />
=== DoOptionsMenu() ===<br />
Options menu is activated by pressing F8 key.<br />
<br />
RunLoader() checks keys and activates; calls DoOptionsMenu() (options.c)<br />
<br />
=FreeLoader loading=<br />
freeldr.sys is started by some type of BootRecord (BR): MBR, VBR, CD boot sector.<br />
<br />
==How bootcd installer usetup.exe writes MBR==<br />
When installing the ReactOS some component should write MBR/VBR to let freeldr.sys start at boot time.<br />
<br />
This is done by usetup.exe : <br />
* BootLoaderHarddiskMbrPage(&Ir) and its helpers: <br />
** InstallMbrBootCodeToDisk()/2 and <br />
** InstallVBRToPartition()/4.<br />
*** InstallFatBootcodeToPartition()/4<br />
<br />
<pre><br />
/** Side note related with bug in usetup.exe -bug writing MBR/VBR in some (frequent) cases: */<br />
<br />
MBRInstallType: usetup.exe variable keeps Boot Record installation mode:<br />
0-None (skip installation) 1-floppy MBR 2-Hdd MBR & VBR <br />
Files:<br />
/base/setup/reactos/ reactos.c : struct SetupData has field MBRInstallType<br />
/base/setup/usetup/interface/ usetup.c : use of MBRInstallType data.<br />
</pre><br />
<br />
'''usetup.exe''' : Page '''''BOOT_LOADER_HARDDISK_MBR_PAGE''''' is handled by: BootLoaderHarddiskMbrPage(&Ir);<br />
( @/base/setup/usetup/interface/usetup.c)<br />
<br />
'''BootLoaderHarddiskMbrPage''' function creates/writes MBR and VBR records.<br />
<br />
''/*** So the main errors are here: This function somehow is not called or the call/subcalls are failed. */''<br />
<br />
<pre><br />
BootLoaderHarddiskMbrPage(&Ir);<br />
/* Step 1: Write the VBR */<br />
InstallVBRToPartition()/4<br />
if (!NT_SUCCESS(Status)) {<br />
MUIDisplayError(ERROR_WRITE_BOOT, Ir, POPUP_WAIT_ENTER);<br />
return QUIT_PAGE;<br />
}<br />
/* Step 2: Write the MBR */<br />
writes bootcd '\loader\dosmbr.bin' into the MBR-place<br />
</pre><br />
<br />
'''InstallVBRToPartition'''/4 (@/base/setup/usetup/bootsup.c)<br />
<pre><br />
InstallVBRToPartition():<br />
if (PartitionType is FAT_PartitionType )<br />
return InstallFatBootcodeToPartition/4<br />
else return STATUS_UNSUCCESSFUL;<br />
</pre><br />
<br />
{| class="wikitable"<br />
|-<br />
! FAT_PartitionType <br />
|-<br />
| PARTITION_FAT_12<br />
|-<br />
| PARTITION_FAT_16<br />
|-<br />
| PARTITION_HUGE<br />
|-<br />
| PARTITION_XINT13<br />
|-<br />
| PARTITION_FAT32<br />
|-<br />
| PARTITION_FAT32_XINT13<br />
|}<br />
<br />
'''InstallFatBootcodeToPartition'''()/4:<br />
<br />
Copies original bootsector file to: %DEST%''\bootsect.ros'' file.<br />
{| class="wikitable"<br />
|-<br />
! FS ID/PartitionType !! Freeloader boot sector binary original name !! Source file name<br />
|-<br />
| FAT32: PARTITION_FAT32, PARTITION_FAT32_XINT13|| fat32.bin || fat32.S<br />
|-<br />
| FAT16: ''else''-branche of ''if''|| fat.bin || fat.S<br />
|-<br />
| otherwise something is failed|| - || -<br />
|}<br />
<br />
'''Legacy''': Also there is a (pretty old,circa 2001) component in ReactOS source: '''''installfreeldr''''' (source: /boot/freeldr/install; binary: unknown). It writes FAT32 MBR only.<br />
<br />
==Boot record types (MBR, VBR, boot sectors, boot records of boot cd/livecd==<br />
TBW: ''InstallFatBootcodeToPartition''-sourced + others (isoboot + ext2(?) etc)<br />
<br />
Parameters boot record passes to FreeLdr: (fat32 & cdrom) (?fat16 doesn't pass DH?)<br />
* boot drive number in DL register. It is BIOS drive number: 0x80 is the 1st drive, 0x81 - 2nd etc.<br />
* boot partition number (0-based) in DH register (0 for CDROM)<br />
<br />
=bootcd and FreeLoader during 1st stage setup=<br />
* ''Note: ReactOS 1st stage setup run by usetup.exe shouldn't be confused with 1st stage loading of (ReactOS or GRUB) bootloader. These are totally different things.''<br />
** ''GRUB loading stages are: 1st stage: loading the MBR, 1.5 stage (...), 2nd stage: running modules from grub host filesystem, from (hdX,msdosY)/boot/grub/i386-pc/*.mod''<br />
<br />
==usetup.exe==<br />
bootcd main installer module is a '''usetup.exe''' (@\base\setup\usetup\*)<br />
<br />
usetup.exe is:<br />
* nativecui module<br />
* Uses libraries: zlib, inflib, ext2lib, vfatlib<br />
<br />
==BootOptions of bootcd==<br />
<br />
BootOptions of bootcd are: '/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE'<br />
<pre><br />
// (../../boot/freeldr/freeldr/windows/setupldr.c:219) trace: BootOptions: '/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE'<br />
</pre><br />
Is read by LoadReactOSSetup(): by setup method of ntoskrnl-loader; designed for usetup.exe.<br />
<br />
Specified in: bootcd.ISO\reactos\txtsetup.sif : SetupData/[Dbg]OsLoadOptions :<br />
<pre><br />
{setupldr.c: InfFindFirstLine(InfHandle, "SetupData", "OsLoadOptions", &InfContext)<br />
or {<br />
{setupldr.c: InfFindFirstLine(InfHandle, "SetupData", "DbgOsLoadOptions", &InfContext)<br />
depending of DBG variable (DBG is now defined by default).<br />
</pre><br />
The source file copied to bootcd.ISO is: \boot\bootdata\txtsetup.sif<br />
<pre><br />
...<br />
[SetupData]<br />
DefaultPath = \ReactOS<br />
OsLoadOptions = "/NOGUIBOOT /NODEBUG"<br />
DbgOsLoadOptions = "/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE"<br />
...<br />
</pre><br />
<br />
== bootcd - Blue TextUI MessageBox "Opening hive file failed!" ==<br />
<br />
Blue TextUI MessageBox "Opening hive file failed!" <br />
<br />
Is a symptom of trying to run bootcd as normal reactos installation, with should has registry.<br />
<br />
bootcd hasn't any registry installed. (look for file: %Root%\SYSTEM32\CONFIG\SYSTEM)<br />
<pre><br />
wlregistry.c: UiMessageBox("Opening hive file failed!");<br />
</pre><br />
of /boot/freeldr/freeldr/windows/wlregistry.c<br />
<br />
'''WinLdrLoadSystemHive()/3'''<br />
<pre><br />
BOOLEAN<br />
WinLdrLoadSystemHive(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock,<br />
IN LPCSTR DirectoryPath,<br />
IN LPCSTR HiveName)<br />
/* Concatenate path and filename to get the full name */<br />
strcpy(FullHiveName, DirectoryPath);<br />
strcat(FullHiveName, HiveName);<br />
//Print(L"Loading %s...\n", FullHiveName);<br />
Status = ArcOpen(FullHiveName, OpenReadOnly, &FileId);<br />
<br />
if (Status != ESUCCESS)<br />
{<br />
*** UiMessageBox("Opening hive file failed!");<br />
return FALSE;<br />
}<br />
</pre><br />
'''WinLdrScanSystemHive()''' calls '''WinLdrLoadSystemHive()'''<br />
<pre><br />
BOOLEAN WinLdrScanSystemHive()/2<br />
strcpy(SearchPath, DirectoryPath);<br />
strcat(SearchPath, "SYSTEM32\\CONFIG\\");<br />
Status = WinLdrLoadSystemHive(LoaderBlock, SearchPath, "SYSTEM");<br />
// Fail if failed...<br />
if (!Status) <br />
return FALSE;<br />
</pre><br />
<br />
== How bootcd is built ==<br />
<br />
Quote from \boot\CMakeLists.txt:<br />
<pre><br />
add_custom_target(bootcd<br />
COMMAND native-cdmake -j -m -b ${CMAKE_CURRENT_BINARY_DIR}/freeldr/bootsect/isoboot.bin \<br />
@${CMAKE_CURRENT_BINARY_DIR}/bootcd.lst REACTOS ${REACTOS_BINARY_DIR}/bootcd.iso<br />
DEPENDS native-cdmake<br />
VERBATIM)<br />
</pre><br />
CMAKE_CURRENT_BINARY_DIR = \output-MinGW-i386\reactos\boot<br />
<br />
'''How livecd is built:'''<br />
<br />
Quote from \boot\CMakeLists.txt:<br />
<pre><br />
add_custom_target(livecd<br />
COMMAND native-cdmake -j -m -b ${CMAKE_CURRENT_BINARY_DIR}/freeldr/bootsect/isoboot.bin \<br />
@${CMAKE_CURRENT_BINARY_DIR}/livecd.lst REACTOS ${REACTOS_BINARY_DIR}/livecd.iso<br />
DEPENDS native-cdmake<br />
VERBATIM)<br />
</pre><br />
<br />
'''How isoboot.bin file is built:'''<br />
<pre>CreateBootSectorTarget(isoboot ${CMAKE_CURRENT_SOURCE_DIR}/isoboot.S ${CMAKE_CURRENT_BINARY_DIR}/isoboot.bin 7000)<br />
</pre><br />
<br />
'''freeldr.sys on livecd:'''<br />
freeldr.sys on Livecd is renamed to setupldr.sys because isoboot.bin looks for setupldr.sys<br />
<br />
= ntoskrnl.exe loading and start =<br />
Entry point : _KiSystemStartup@4; subsystem:native</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna.&diff=34663User:Mna.2014-03-25T10:43:58Z<p>Mna.: /* (Generic) Development */</p>
<hr />
<div>My patches to ReactOS// My Bookmarks with useful info// Future place for Manifest-like texts.<br />
<br />
==My Patches/WIP==<br />
''(WIP = Work in Progress)''<br />
* [Done] dmesg/kmesg command in ReactOS native kernel debugger [https://jira.reactos.org/browse/CORE-5452 CORE-5452], described there.<br />
** --<br />
* [Done/not-included] dmesg.exe User-mode utility: done. but not applied (.rbuild system was broken/removed then at the moment + 3 month delay of community considering accepting my kmesg patch).<br />
* WIP (Important thing): MMIO for serial card at kernel early-boot. -- MMIO serial cards doesn't work at all in ROS.<br />
* [Done] micropatch: print CPUs count and available RAM at ROS start (work related with low-memory related bug)<br />
* (..describe later..: partitions' bug, FAT32-moved-root-node, etc)<br />
* usetup.c - series: [http://jira.reactos.org/browse/CORE-7969 CORE-7969] submitted patch at 08.03.2014: will see how long it will stay not applied. (+1week later)<br />
<br />
==Issues: Reported and not yet==<br />
* [http://jira.reactos.org/browse/CORE-7978 CORE-7978] - ReactOS boot code of MBR can't boot USB-HDD due to error reading sectors with int13h_ah=42h<br />
** Added there link to very good explanation how does GRUB stage1 loader work! Just an amazingly detailed description (and also even with joke in stage2!) [http://thestarman.pcministry.com/asm/mbr/GRUB.htm This] link.<br />
** Workaround: use grub-2 to load freeldr.sys<br />
** freeldr.ini also requires editing the rdisk() parameter addressing the disks:<br />
SystemPath=multi(0)disk(0)rdisk(1)partition(2)\ReactOS<br />
<br />
rdisk(1)partition(2) here means: 2nd disk, 2nd partition. (partitions are 1-counted, rdisks - 0-counted.)<br />
<br />
* [Yet old bug of 2010/11 times until now] (On my machine: AcerAspire5920g) ReactOS loading process stuck on line ...\Drivers\DISK.SYS when Disk operation mode in BIOS is set to AHCI. Changed the mode to IDE "workarounds" the problem: ntoskrnl.exe reaches the last line ...\Drivers\NDIS.SYS -- and is stuck somewhere more later -- eating 100% CPU. (//Debug-log is required)<br />
So the summary: SATA2 is not fully supported by ReactOS, forced to use IDE.<br />
<br />
==MyBookmarks==<br />
Interesting topics, links (Started at 2011-04-03)<br />
<br />
Here I will keep links to forum topics, wiki pages or other, that seemed to be interesting:<br />
<br />
====(Generic) Development====<br />
* [http://jira.reactos.org/issues/?filter=-4 All issues of ReactOS] [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20ORDER%20BY%20createdDate%20DESC bugs only]<br />
* [[Missing ReactOS Functionality]] - major things absent of ROS from User PoV<br />
* [http://jira.reactos.org/issues/?filter=-4&jql=issuetype%20%3D%20Bug%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29%20ORDER%20BY%20priority%20DESC%2C%20createdDate%20DESC Sorted by importance (''priority'' now in JIRA) bugs of ReactOS], excepto of resolved ones<br />
<br />
* [http://www.reactos.org/wiki/How_PnP_Works_in_ReactOS How PnP Works in ReactOS]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8459 ReactOS, how much money it requires?] - here is only the idea, to be converted to become more correct: "How many man-months?", given man-month is more like a myth, reconsider on per-project basis<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8126 HOWTO Become a Reactos Programmer?] - forum topic, could be converted to more constructive instruction<br />
* [http://dslab.epfl.ch/proj/reveng RevEng: Device Driver Reverse Engineering] from [http://www.reactos.org/forum/viewtopic.php?f=9&t=7990 here]<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=8206 Command-line-only Win32 from ReactOS?] The topic about full OS without GUI ("headless"?).<br />
** Resembles me idea of [http://hex.pp.ua/nt-native-applications-shell-eng.php Windows/ReactOS Native Shell]) ([http://www.reactos.org/forum/viewtopic.php?f=11&t=9092 Russian]).<br />
* [[Modify the final ISO image]] - good article, have also notes on how (bootcd) final CD-image is composed<br />
* [http://iso.reactos.org/bootcd/ bootcd repository] iso.reactos.org bootcd images<br />
* [http://iso.reactos.org/livecd/ livecd repository]<br />
<br />
* [[FreeLoader]], details, [[User:Mna./FreeLoader,_bootcd_and_bootrecords#FreeLoader_freeldr_Architecture|freeldr Architecture]] and related startup steps: [[User:Mna./FreeLoader,_bootcd_and_bootrecords|bootcd and bootrecords]]<br />
* [http://en.wikipedia.org/wiki/Windows_NT_Startup_Process Windows NT Startup Process/ Sequence]<br />
* Developer help:<br />
** [[Building_Modules#List_available_ninja_targets|available ninja targets]]<br />
** [[Building_Modules#Removing_or_Updating_a_Module|Updating a module code]] -- do this when the ROS module code was changed and build system didn't notice<br />
** Strange thing/fine suprise: Ctrl+D works in 1st stage setup(?!).<br />
BootOptions=DbgOsLoadOptions = "/NOGUIBOOT /DEBUGPORT=COM:io,0x3f8,115200n8 /DEBUGPORT=SCREEN" See also [[User:Mna./FreeLoader_freeldr_Architecture#Specifing_Boot_Options|Specifing Boot kernel Options]]<br />
* [irc://irc.freenode.net/reactos #reactos] - For general discussion and user support, most people are here<br />
<br />
====Filesystems generic====<br />
* [[File Systems]], a good page<br />
<br />
====Editing ReactOS registry offline====<br />
From [http://www.reactos.org/forum/viewtopic.php?t=3162 here]<br />
{| class="wikitable"<br />
|-<br />
| <br />
Editing ReactOS registry hives outside ReactOS?<br />
--2006-12<br />
<br />
> Is it possible at this moment to edit the registry hives outside the ReactOS environment?<br />
> I wanted to automate a process to load these registry hives onto the local registry, <br />
> add all my changes, unload the hives and create a new ISO.<br />
<br />
Simply change registry sources and build your own binary hives from them.<br />
<br />
by hto <br/><br />
<br />
> I guess "make" is the prefered way, there isn't any other method for creating these hives?<br /><br />
<br />
There is hive maker in tools\mkhive. You can build it with mingw32-make.exe mkhive<br />
<br />
Copy it from output-i386\tools\mkhive\mkhive.exe to (say) Windows\mkhive.exe.<br />
Then run this command:<br />
<br />
mkhive.exe boot\bootdata output-i386\livecd\reactos\system32\config boot\bootdata\livecd.inf boot\bootdata\hiveinst.inf<br />
<br />
Where output-i386\livecd\reactos\system32\config -- is output folder for hives.<br />
This is how ''make livecd'' does it.<br />
And yes, you can add your foo.inf to the end of that command.<br />
|}<br />
<br />
====NTFS====<br />
* post about [http://www.reactos.org/forum/viewtopic.php?f=9&t=8180#p71875 FUSE-lib creation attempts in ROS] in the "[http://www.reactos.org/forum/viewtopic.php?f=9&t=8180 NTFS question]" topic<br />
* (ru) [http://www.reactos.org/forum/viewtopic.php?f=11&t=8606 NTFS-3G applied to ROS], with ''unixed'' 's idea how to integrate into the '''fuse4win''' or '''dokan'''<br />
<br />
====Misc====<br />
* [http://alter.org.ua/soft/win/uni_ata/ UniATA] project link, Current version is 0.40b2, Updated @2011.03.24. ROS wasn't sinced with it since version-'?.?'...<br />
* [http://alter.org.ua/en/soft/win/vidcontrol/ Display Control for Windows], Alter's site; Now part of [http://alter.org.ua/en/soft/win/uictl/ UI ctl]<br />
<br />
===Serial extension card and MMIO programming===<br />
* [https://android.googlesource.com/kernel/omap/+/glass-omap-xrr02/drivers/tty/serial/8250_early.c android kernel driver tty-serial 8250_early.c] : as serial debug interface, Android can specify not only IO-ports, but also MMIO and MMIO32 addresses. The "shentek" serial card which I own, requires such communication method, it is based on Oxford chip and gives only mmio interface.<br />
* MMIO [http://en.wikipedia.org/wiki/Memory-mapped_I/O MMIO = Memory-mapped_I/O] Linux:[http://nouveau.freedesktop.org/wiki/MmioTrace/ MmioTrace Home] [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/trace/mmiotrace.txt mmiotrace doc]<br />
<br />
**'''Note: I have much info/hands-on to add here...'''<br />
<br />
===Debug prints in ROS===<br />
* [http://alter.org.ua/docs/nt_kernel/kdprint/ KdPrint/DbgPrint and OutputDebugString behavior] at Alter's site,<br />
* [http://www.codeproject.com/KB/winsdk/OutputDebugString.aspx?display=Print Mechanism of OutputDebugString - CodeProject] the ready code sample,<br />
They (articles) discuss internals and mechanism of OutputDebugString. Definitely Windows too (as unices) uses system calls to store and receive debug messages data to/from kernel debug messages buffer.<br />
<br />
** [http://www.reactos.org/wiki/Enable_kernel_tracing ROS: Enable kernel tracing]<br />
<br />
<br />
====Unix dmesg Internals Analysis====<br />
''for comparison and for creating something equivalent/analogous in ROS''<br />
Shortly:<br />
*'''Linux''' has special system call "'''syslog'''" (man 2 syslog)<br />
*'''FreeBSD''' uses its special '''sysctl''' interface to kernel along with "'''kern.msgbuf'''" parameter.<br />
<br />
'''D'''o we need special system call like Linux, or even more, the whole<br />
family of them (sysctl('*')) as in BSD?<br />
How to implement simple system call for it, now?<br />
<br />
---<br />
<br />
Detailed info for unices:<br />
<br />
'''Linux case''':<br />
* syslog(2) - read and/or clear kernel message ring buffer; set console_loglevel<br />
int syslog(int type, char *bufp, int len);<br />
* also /proc/kmsg virtual file, which when being read returns buffer contents<br />
<br />
Excerpt from "man proc":<br />
<pre><br />
/proc/kmsg<br />
This file can be used instead of the syslog(2) system<br />
call to read kernel messages. A<br />
process must have superuser privileges to read this<br />
file, and only one process should read<br />
this file. This file should not be read if a syslog<br />
process is running which uses the sys‐<br />
log(2) system call facility to log kernel messages.<br />
<br />
Information in this file is retrieved with the dmesg(1) program.<br />
</pre><br />
<br />
'''dmesg in FreeBSD''':<br />
*Parameter 'kern.msgbuf' given to sysctl(3) returns contents of kernel message buffer.<br />
*There is also 'kern.msgbuf_clear' to clean the buffer.<br />
<br />
<br />
====/*USB====<br />
These could be probably outdated in sense the USB now is in better working state.<br />
* [http://wiki.osdev.org/Main osdev.org wiki] - main page, [http://wiki.osdev.org/USB USB, the same place]<br />
* USB for NT4:<br />
** Alter's site reviews: [http://alter.org.ua/en/docs/win/nt4_usb/ en], [http://alter.org.ua/ru/docs/win/nt4_usb/ ru]<br />
** Woodheads opensource(!), GPL USB driver: [ftp://piekraste.daba.lv/pub/Service_Pack/NT_4/NT4_USB/HS/ files backed up] [http://www.geocities.com/mypublic99/index.html "Woodhead--NT4--USB" original link (dead)]<br />
** [http://nt4ref.zcm.com.au/usb.htm Windows NT 4.0 and USB] Quote: "Conclusion: I wish people would stop making comments like 'USB is not supported under NT4' - If you must comment please make it accurate, example: 'Microsoft have made the commercial decision not to provide NT4 USB support - but some manufacturers provide support for specific USB devices on NT4.'"<br />
<br />
====*/====<br />
<br />
<br />
=== FreeLoader, debug information, getting===<br />
Related with low-memory bug: 1) 4Gb was recognized as 25Mb 2) ROS started with 25Mb silently eat up 100% CPU and infinitely read from boot CD/HDD.<br />
* Debugging the FreeLdr: [http://jira.reactos.org/secure/attachment/16335/freeldr.patch freeldr.patch turning on debug mode] from [http://jira.reactos.org/browse/CORE-5462 CORE-5462] -- patch by ''rafalh''<br />
* [[FreeLoader]]<br />
<br />
Misc...<br />
* [http://www.reactos.org/forum/viewtopic.php?f=9&t=7915#p68991 by gabrielilardi @ 20 Jan 2010, forum of ROS]<br />
* [http://www.reactos.org/forum/viewtopic.php?p=62488#p62488 by hto @13 Jul 2009]<br />
<br />
===SVN how-to links===<br />
* [http://subversion.apache.org/faq.html] found through google [svn through proxy]<br />
* [http://www.mikepot.com/1544.html], same<br />
* SVN book: [http://svn.zen-cart.org.ua/documentation/en/book/svn-book.html Version Control with Subversion 1.2]<br />
** [http://svn.zen-cart.org.ua/documentation/ru/book/ Same SVN guide, russian]</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna./FreeLoader,_bootcd_and_bootrecords&diff=34661User:Mna./FreeLoader, bootcd and bootrecords2014-03-25T10:41:34Z<p>Mna.: Mna. moved page User:Mna./FreeLoader freeldr Architecture to User:Mna./FreeLoader, bootcd and bootrecords: update</p>
<hr />
<div>=FreeLoader freeldr Architecture=<br />
<br />
==FreeLoader Initialization==<br />
When FreeLoader gets control it <br />
* saves the boot drive, passed to it in the DL register, partition number passed in the DH register<br />
* sets up the stack, <br />
* enables protected mode, and <br />
* calls BootMain().<br />
--based on quote from \boot\freeldr\notes.txt<br />
<br />
==BootMain==<br />
VOID BootMain(LPSTR CmdLine) is layed in \boot\freeldr\freeldr\freeldr.c<br />
<br />
It is main Freeldr function:<br />
<br />
<pre><br />
VOID BootMain(LPSTR CmdLine)<br />
{<br />
CmdLineParse(CmdLine);<br />
MachInit(CmdLine);<br />
FsInit();<br />
DebugInit();<br />
TRACE("BootMain() called.\n");<br />
<br />
if (!UiInitialize(FALSE))<br />
{<br />
UiMessageBoxCritical("Unable to initialize UI.\n");<br />
goto quit;<br />
}<br />
if (!MmInitializeMemoryManager())<br />
{<br />
UiMessageBoxCritical("Unable to initialize memory manager");<br />
goto quit;<br />
}<br />
#ifdef _M_IX86<br />
HalpInitializePciStubs();<br />
HalpInitBusHandler();<br />
#endif<br />
RunLoader();<br />
<br />
quit:<br />
/* If we reach this point, something went wrong before, therefore reboot */<br />
DiskStopFloppyMotor();<br />
Reboot();<br />
}<br />
</pre><br />
<br />
\boot\freeldr\freeldr\debug.c : DebugInit()<br />
Initializes Rs232 port, among other things.<br />
<br />
==OS_LOADING_METHOD==<br />
'''BootMain'''() calls '''RunLoader'''() //bootmgr.c<br />
<br />
'''RunLoader'''() calls '''LoadOperatingSystem'''()<br />
<br />
'''LoadOperatingSystem'''() lookups the OS_LOADING_METHOD and calls found loading method.<br />
//\boot\freeldr\freeldr\bootmgr.c<br />
//VOID LoadOperatingSystem(IN OperatingSystemItem* OperatingSystem);<br />
<br />
OS_LOADING_METHOD is a function pointer field in the table of OSLoadingMethods (in bootmgr.c) :<br />
<pre><br />
typedef VOID (*OS_LOADING_METHOD)(IN OperatingSystemItem* OperatingSystem,<br />
IN USHORT OperatingSystemVersion);<br />
</pre><br />
Most used loading methods are: '''LoadAndBootWindows'''(), '''LoadReactOSSetup'''()<br />
// \boot\freeldr\freeldr\windows\ {winldr.c,setupldr.c}<br />
<br />
Windows2003/LoadAndBootWindows() is a normal/default loading method, called by installed ReactOS.<br />
ReactOSSetup/LoadReactOSSetup() is a method called by ReactOS bootcd installer ''usetup.exe''.<br />
<br />
List of all ReactOS loading methods:<br />
<pre><br />
{"ReactOSSetup", 0 , LoadReactOSSetup },<br />
#ifdef _M_IX86<br />
{"BootSector" , 0 , LoadAndBootBootSector},<br />
{"Drive" , 0 , LoadAndBootDrive },<br />
{"Partition" , 0 , LoadAndBootPartition },<br />
<br />
{"Linux" , 0 , LoadAndBootLinux },<br />
<br />
{"Windows" , 0 , LoadAndBootWindows },<br />
{"WindowsNT40" , _WIN32_WINNT_NT4 , LoadAndBootWindows },<br />
#endif<br />
{"Windows2003" , _WIN32_WINNT_WS03, LoadAndBootWindows },<br />
</pre><br />
<br />
== DoOptionsMenu() ==<br />
Options menu is activated by pressing F8 key.<br />
<br />
RunLoader() checks keys and activates; calls DoOptionsMenu() (options.c)<br />
<br />
=FreeLoader loading=<br />
freeldr.sys is started by some type of BootRecord (BR): MBR, VBR, CD boot sector.<br />
<br />
==How bootcd installer usetup.exe writes MBR==<br />
When installing the ReactOS some component should write MBR/VBR to let freeldr.sys start at boot time.<br />
<br />
This is done by usetup.exe : <br />
* BootLoaderHarddiskMbrPage(&Ir) and its helpers: <br />
** InstallMbrBootCodeToDisk()/2 and <br />
** InstallVBRToPartition()/4.<br />
*** InstallFatBootcodeToPartition()/4<br />
<br />
<pre><br />
/** Side note related with bug in usetup.exe -bug writing MBR/VBR in some (frequent) cases: */<br />
<br />
MBRInstallType: usetup.exe variable keeps Boot Record installation mode:<br />
0-None (skip installation) 1-floppy MBR 2-Hdd MBR & VBR <br />
Files:<br />
/base/setup/reactos/ reactos.c : struct SetupData has field MBRInstallType<br />
/base/setup/usetup/interface/ usetup.c : use of MBRInstallType data.<br />
</pre><br />
<br />
'''usetup.exe''' : Page '''''BOOT_LOADER_HARDDISK_MBR_PAGE''''' is handled by: BootLoaderHarddiskMbrPage(&Ir);<br />
( @/base/setup/usetup/interface/usetup.c)<br />
<br />
'''BootLoaderHarddiskMbrPage''' function creates/writes MBR and VBR records.<br />
<br />
''/*** So the main errors are here: This function somehow is not called or the call/subcalls are failed. */''<br />
<br />
<pre><br />
BootLoaderHarddiskMbrPage(&Ir);<br />
/* Step 1: Write the VBR */<br />
InstallVBRToPartition()/4<br />
if (!NT_SUCCESS(Status)) {<br />
MUIDisplayError(ERROR_WRITE_BOOT, Ir, POPUP_WAIT_ENTER);<br />
return QUIT_PAGE;<br />
}<br />
/* Step 2: Write the MBR */<br />
writes bootcd '\loader\dosmbr.bin' into the MBR-place<br />
</pre><br />
<br />
'''InstallVBRToPartition'''/4 (@/base/setup/usetup/bootsup.c)<br />
<pre><br />
InstallVBRToPartition():<br />
if (PartitionType is FAT_PartitionType )<br />
return InstallFatBootcodeToPartition/4<br />
else return STATUS_UNSUCCESSFUL;<br />
</pre><br />
<br />
{| class="wikitable"<br />
|-<br />
! FAT_PartitionType <br />
|-<br />
| PARTITION_FAT_12<br />
|-<br />
| PARTITION_FAT_16<br />
|-<br />
| PARTITION_HUGE<br />
|-<br />
| PARTITION_XINT13<br />
|-<br />
| PARTITION_FAT32<br />
|-<br />
| PARTITION_FAT32_XINT13<br />
|}<br />
<br />
'''InstallFatBootcodeToPartition'''()/4:<br />
<br />
Copies original bootsector file to: %DEST%''\bootsect.ros'' file.<br />
{| class="wikitable"<br />
|-<br />
! FS ID/PartitionType !! Freeloader boot sector binary original name !! Source file name<br />
|-<br />
| FAT32: PARTITION_FAT32, PARTITION_FAT32_XINT13|| fat32.bin || fat32.S<br />
|-<br />
| FAT16: ''else''-branche of ''if''|| fat.bin || fat.S<br />
|-<br />
| otherwise something is failed|| - || -<br />
|}<br />
<br />
'''Legacy''': Also there is a (pretty old,circa 2001) component in ReactOS source: '''''installfreeldr''''' (source: /boot/freeldr/install; binary: unknown). It writes FAT32 MBR only.<br />
<br />
==Boot record types (MBR, VBR, boot sectors, boot records of boot cd/livecd==<br />
TBW: ''InstallFatBootcodeToPartition''-sourced + others (isoboot + ext2(?) etc)<br />
<br />
Parameters boot record passes to FreeLdr: (fat32 & cdrom) (?fat16 doesn't pass DH?)<br />
* boot drive number in DL register. It is BIOS drive number: 0x80 is the 1st drive, 0x81 - 2nd etc.<br />
* boot partition number (0-based) in DH register (0 for CDROM)<br />
<br />
=bootcd and FreeLoader during 1st stage setup=<br />
* ''Note: ReactOS 1st stage setup run by usetup.exe shouldn't be confused with 1st stage loading of (ReactOS or GRUB) bootloader. These are totally different things.''<br />
** ''GRUB loading stages are: 1st stage: loading the MBR, 1.5 stage (...), 2nd stage: running modules from grub host filesystem, from (hdX,msdosY)/boot/grub/i386-pc/*.mod''<br />
<br />
==usetup.exe==<br />
bootcd main installer module is a '''usetup.exe''' (@\base\setup\usetup\*)<br />
<br />
usetup.exe is:<br />
* nativecui module<br />
* Uses libraries: zlib, inflib, ext2lib, vfatlib<br />
<br />
==BootOptions of bootcd==<br />
<br />
BootOptions of bootcd are: '/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE'<br />
<pre><br />
// (../../boot/freeldr/freeldr/windows/setupldr.c:219) trace: BootOptions: '/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE'<br />
</pre><br />
Is read by LoadReactOSSetup(): by setup method of ntoskrnl-loader; designed for usetup.exe.<br />
<br />
Specified in: bootcd.ISO\reactos\txtsetup.sif : SetupData/[Dbg]OsLoadOptions :<br />
<pre><br />
{setupldr.c: InfFindFirstLine(InfHandle, "SetupData", "OsLoadOptions", &InfContext)<br />
or {<br />
{setupldr.c: InfFindFirstLine(InfHandle, "SetupData", "DbgOsLoadOptions", &InfContext)<br />
depending of DBG variable (DBG is now defined by default).<br />
</pre><br />
The source file copied to bootcd.ISO is: \boot\bootdata\txtsetup.sif<br />
<pre><br />
...<br />
[SetupData]<br />
DefaultPath = \ReactOS<br />
OsLoadOptions = "/NOGUIBOOT /NODEBUG"<br />
DbgOsLoadOptions = "/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE"<br />
...<br />
</pre><br />
<br />
== bootcd - Blue TextUI MessageBox "Opening hive file failed!" ==<br />
<br />
Blue TextUI MessageBox "Opening hive file failed!" <br />
<br />
Is a symptom of trying to run bootcd as normal reactos installation, with should has registry.<br />
<br />
bootcd hasn't any registry installed. (look for file: %Root%\SYSTEM32\CONFIG\SYSTEM)<br />
<pre><br />
wlregistry.c: UiMessageBox("Opening hive file failed!");<br />
</pre><br />
of /boot/freeldr/freeldr/windows/wlregistry.c<br />
<br />
'''WinLdrLoadSystemHive()/3'''<br />
<pre><br />
BOOLEAN<br />
WinLdrLoadSystemHive(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock,<br />
IN LPCSTR DirectoryPath,<br />
IN LPCSTR HiveName)<br />
/* Concatenate path and filename to get the full name */<br />
strcpy(FullHiveName, DirectoryPath);<br />
strcat(FullHiveName, HiveName);<br />
//Print(L"Loading %s...\n", FullHiveName);<br />
Status = ArcOpen(FullHiveName, OpenReadOnly, &FileId);<br />
<br />
if (Status != ESUCCESS)<br />
{<br />
*** UiMessageBox("Opening hive file failed!");<br />
return FALSE;<br />
}<br />
</pre><br />
'''WinLdrScanSystemHive()''' calls '''WinLdrLoadSystemHive()'''<br />
<pre><br />
BOOLEAN WinLdrScanSystemHive()/2<br />
strcpy(SearchPath, DirectoryPath);<br />
strcat(SearchPath, "SYSTEM32\\CONFIG\\");<br />
Status = WinLdrLoadSystemHive(LoaderBlock, SearchPath, "SYSTEM");<br />
// Fail if failed...<br />
if (!Status) <br />
return FALSE;<br />
</pre><br />
<br />
== How bootcd is built ==<br />
<br />
Quote from \boot\CMakeLists.txt:<br />
<pre><br />
add_custom_target(bootcd<br />
COMMAND native-cdmake -j -m -b ${CMAKE_CURRENT_BINARY_DIR}/freeldr/bootsect/isoboot.bin \<br />
@${CMAKE_CURRENT_BINARY_DIR}/bootcd.lst REACTOS ${REACTOS_BINARY_DIR}/bootcd.iso<br />
DEPENDS native-cdmake<br />
VERBATIM)<br />
</pre><br />
CMAKE_CURRENT_BINARY_DIR = \output-MinGW-i386\reactos\boot<br />
<br />
'''How livecd is built:'''<br />
<br />
Quote from \boot\CMakeLists.txt:<br />
<pre><br />
add_custom_target(livecd<br />
COMMAND native-cdmake -j -m -b ${CMAKE_CURRENT_BINARY_DIR}/freeldr/bootsect/isoboot.bin \<br />
@${CMAKE_CURRENT_BINARY_DIR}/livecd.lst REACTOS ${REACTOS_BINARY_DIR}/livecd.iso<br />
DEPENDS native-cdmake<br />
VERBATIM)<br />
</pre><br />
<br />
'''How isoboot.bin file is built:'''<br />
<pre>CreateBootSectorTarget(isoboot ${CMAKE_CURRENT_SOURCE_DIR}/isoboot.S ${CMAKE_CURRENT_BINARY_DIR}/isoboot.bin 7000)<br />
</pre><br />
<br />
'''freeldr.sys on livecd:'''<br />
freeldr.sys on Livecd is renamed to setupldr.sys because isoboot.bin looks for setupldr.sys<br />
<br />
= ntoskrnl.exe loading and start =<br />
Entry point : _KiSystemStartup@4; subsystem:native</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna./FreeLoader_freeldr_Architecture&diff=34662User:Mna./FreeLoader freeldr Architecture2014-03-25T10:41:34Z<p>Mna.: Mna. moved page User:Mna./FreeLoader freeldr Architecture to User:Mna./FreeLoader, bootcd and bootrecords: update</p>
<hr />
<div>#REDIRECT [[User:Mna./FreeLoader, bootcd and bootrecords]]</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna./FreeLoader,_bootcd_and_bootrecords&diff=34660User:Mna./FreeLoader, bootcd and bootrecords2014-03-25T10:34:58Z<p>Mna.: /* usetup.exe */</p>
<hr />
<div>=FreeLoader freeldr Architecture=<br />
<br />
==FreeLoader Initialization==<br />
When FreeLoader gets control it <br />
* saves the boot drive, passed to it in the DL register, partition number passed in the DH register<br />
* sets up the stack, <br />
* enables protected mode, and <br />
* calls BootMain().<br />
--based on quote from \boot\freeldr\notes.txt<br />
<br />
==BootMain==<br />
VOID BootMain(LPSTR CmdLine) is layed in \boot\freeldr\freeldr\freeldr.c<br />
<br />
It is main Freeldr function:<br />
<br />
<pre><br />
VOID BootMain(LPSTR CmdLine)<br />
{<br />
CmdLineParse(CmdLine);<br />
MachInit(CmdLine);<br />
FsInit();<br />
DebugInit();<br />
TRACE("BootMain() called.\n");<br />
<br />
if (!UiInitialize(FALSE))<br />
{<br />
UiMessageBoxCritical("Unable to initialize UI.\n");<br />
goto quit;<br />
}<br />
if (!MmInitializeMemoryManager())<br />
{<br />
UiMessageBoxCritical("Unable to initialize memory manager");<br />
goto quit;<br />
}<br />
#ifdef _M_IX86<br />
HalpInitializePciStubs();<br />
HalpInitBusHandler();<br />
#endif<br />
RunLoader();<br />
<br />
quit:<br />
/* If we reach this point, something went wrong before, therefore reboot */<br />
DiskStopFloppyMotor();<br />
Reboot();<br />
}<br />
</pre><br />
<br />
\boot\freeldr\freeldr\debug.c : DebugInit()<br />
Initializes Rs232 port, among other things.<br />
<br />
==OS_LOADING_METHOD==<br />
'''BootMain'''() calls '''RunLoader'''() //bootmgr.c<br />
<br />
'''RunLoader'''() calls '''LoadOperatingSystem'''()<br />
<br />
'''LoadOperatingSystem'''() lookups the OS_LOADING_METHOD and calls found loading method.<br />
//\boot\freeldr\freeldr\bootmgr.c<br />
//VOID LoadOperatingSystem(IN OperatingSystemItem* OperatingSystem);<br />
<br />
OS_LOADING_METHOD is a function pointer field in the table of OSLoadingMethods (in bootmgr.c) :<br />
<pre><br />
typedef VOID (*OS_LOADING_METHOD)(IN OperatingSystemItem* OperatingSystem,<br />
IN USHORT OperatingSystemVersion);<br />
</pre><br />
Most used loading methods are: '''LoadAndBootWindows'''(), '''LoadReactOSSetup'''()<br />
// \boot\freeldr\freeldr\windows\ {winldr.c,setupldr.c}<br />
<br />
Windows2003/LoadAndBootWindows() is a normal/default loading method, called by installed ReactOS.<br />
ReactOSSetup/LoadReactOSSetup() is a method called by ReactOS bootcd installer ''usetup.exe''.<br />
<br />
List of all ReactOS loading methods:<br />
<pre><br />
{"ReactOSSetup", 0 , LoadReactOSSetup },<br />
#ifdef _M_IX86<br />
{"BootSector" , 0 , LoadAndBootBootSector},<br />
{"Drive" , 0 , LoadAndBootDrive },<br />
{"Partition" , 0 , LoadAndBootPartition },<br />
<br />
{"Linux" , 0 , LoadAndBootLinux },<br />
<br />
{"Windows" , 0 , LoadAndBootWindows },<br />
{"WindowsNT40" , _WIN32_WINNT_NT4 , LoadAndBootWindows },<br />
#endif<br />
{"Windows2003" , _WIN32_WINNT_WS03, LoadAndBootWindows },<br />
</pre><br />
<br />
== DoOptionsMenu() ==<br />
Options menu is activated by pressing F8 key.<br />
<br />
RunLoader() checks keys and activates; calls DoOptionsMenu() (options.c)<br />
<br />
=FreeLoader loading=<br />
freeldr.sys is started by some type of BootRecord (BR): MBR, VBR, CD boot sector.<br />
<br />
==How bootcd installer usetup.exe writes MBR==<br />
When installing the ReactOS some component should write MBR/VBR to let freeldr.sys start at boot time.<br />
<br />
This is done by usetup.exe : <br />
* BootLoaderHarddiskMbrPage(&Ir) and its helpers: <br />
** InstallMbrBootCodeToDisk()/2 and <br />
** InstallVBRToPartition()/4.<br />
*** InstallFatBootcodeToPartition()/4<br />
<br />
<pre><br />
/** Side note related with bug in usetup.exe -bug writing MBR/VBR in some (frequent) cases: */<br />
<br />
MBRInstallType: usetup.exe variable keeps Boot Record installation mode:<br />
0-None (skip installation) 1-floppy MBR 2-Hdd MBR & VBR <br />
Files:<br />
/base/setup/reactos/ reactos.c : struct SetupData has field MBRInstallType<br />
/base/setup/usetup/interface/ usetup.c : use of MBRInstallType data.<br />
</pre><br />
<br />
'''usetup.exe''' : Page '''''BOOT_LOADER_HARDDISK_MBR_PAGE''''' is handled by: BootLoaderHarddiskMbrPage(&Ir);<br />
( @/base/setup/usetup/interface/usetup.c)<br />
<br />
'''BootLoaderHarddiskMbrPage''' function creates/writes MBR and VBR records.<br />
<br />
''/*** So the main errors are here: This function somehow is not called or the call/subcalls are failed. */''<br />
<br />
<pre><br />
BootLoaderHarddiskMbrPage(&Ir);<br />
/* Step 1: Write the VBR */<br />
InstallVBRToPartition()/4<br />
if (!NT_SUCCESS(Status)) {<br />
MUIDisplayError(ERROR_WRITE_BOOT, Ir, POPUP_WAIT_ENTER);<br />
return QUIT_PAGE;<br />
}<br />
/* Step 2: Write the MBR */<br />
writes bootcd '\loader\dosmbr.bin' into the MBR-place<br />
</pre><br />
<br />
'''InstallVBRToPartition'''/4 (@/base/setup/usetup/bootsup.c)<br />
<pre><br />
InstallVBRToPartition():<br />
if (PartitionType is FAT_PartitionType )<br />
return InstallFatBootcodeToPartition/4<br />
else return STATUS_UNSUCCESSFUL;<br />
</pre><br />
<br />
{| class="wikitable"<br />
|-<br />
! FAT_PartitionType <br />
|-<br />
| PARTITION_FAT_12<br />
|-<br />
| PARTITION_FAT_16<br />
|-<br />
| PARTITION_HUGE<br />
|-<br />
| PARTITION_XINT13<br />
|-<br />
| PARTITION_FAT32<br />
|-<br />
| PARTITION_FAT32_XINT13<br />
|}<br />
<br />
'''InstallFatBootcodeToPartition'''()/4:<br />
<br />
Copies original bootsector file to: %DEST%''\bootsect.ros'' file.<br />
{| class="wikitable"<br />
|-<br />
! FS ID/PartitionType !! Freeloader boot sector binary original name !! Source file name<br />
|-<br />
| FAT32: PARTITION_FAT32, PARTITION_FAT32_XINT13|| fat32.bin || fat32.S<br />
|-<br />
| FAT16: ''else''-branche of ''if''|| fat.bin || fat.S<br />
|-<br />
| otherwise something is failed|| - || -<br />
|}<br />
<br />
'''Legacy''': Also there is a (pretty old,circa 2001) component in ReactOS source: '''''installfreeldr''''' (source: /boot/freeldr/install; binary: unknown). It writes FAT32 MBR only.<br />
<br />
==Boot record types (MBR, VBR, boot sectors, boot records of boot cd/livecd==<br />
TBW: ''InstallFatBootcodeToPartition''-sourced + others (isoboot + ext2(?) etc)<br />
<br />
Parameters boot record passes to FreeLdr: (fat32 & cdrom) (?fat16 doesn't pass DH?)<br />
* boot drive number in DL register. It is BIOS drive number: 0x80 is the 1st drive, 0x81 - 2nd etc.<br />
* boot partition number (0-based) in DH register (0 for CDROM)<br />
<br />
=bootcd and FreeLoader during 1st stage setup=<br />
* ''Note: ReactOS 1st stage setup run by usetup.exe shouldn't be confused with 1st stage loading of (ReactOS or GRUB) bootloader. These are totally different things.''<br />
** ''GRUB loading stages are: 1st stage: loading the MBR, 1.5 stage (...), 2nd stage: running modules from grub host filesystem, from (hdX,msdosY)/boot/grub/i386-pc/*.mod''<br />
<br />
==usetup.exe==<br />
bootcd main installer module is a '''usetup.exe''' (@\base\setup\usetup\*)<br />
<br />
usetup.exe is:<br />
* nativecui module<br />
* Uses libraries: zlib, inflib, ext2lib, vfatlib<br />
<br />
==BootOptions of bootcd==<br />
<br />
BootOptions of bootcd are: '/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE'<br />
<pre><br />
// (../../boot/freeldr/freeldr/windows/setupldr.c:219) trace: BootOptions: '/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE'<br />
</pre><br />
Is read by LoadReactOSSetup(): by setup method of ntoskrnl-loader; designed for usetup.exe.<br />
<br />
Specified in: bootcd.ISO\reactos\txtsetup.sif : SetupData/[Dbg]OsLoadOptions :<br />
<pre><br />
{setupldr.c: InfFindFirstLine(InfHandle, "SetupData", "OsLoadOptions", &InfContext)<br />
or {<br />
{setupldr.c: InfFindFirstLine(InfHandle, "SetupData", "DbgOsLoadOptions", &InfContext)<br />
depending of DBG variable (DBG is now defined by default).<br />
</pre><br />
The source file copied to bootcd.ISO is: \boot\bootdata\txtsetup.sif<br />
<pre><br />
...<br />
[SetupData]<br />
DefaultPath = \ReactOS<br />
OsLoadOptions = "/NOGUIBOOT /NODEBUG"<br />
DbgOsLoadOptions = "/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE"<br />
...<br />
</pre><br />
<br />
== bootcd - Blue TextUI MessageBox "Opening hive file failed!" ==<br />
<br />
Blue TextUI MessageBox "Opening hive file failed!" <br />
<br />
Is a symptom of trying to run bootcd as normal reactos installation, with should has registry.<br />
<br />
bootcd hasn't any registry installed. (look for file: %Root%\SYSTEM32\CONFIG\SYSTEM)<br />
<pre><br />
wlregistry.c: UiMessageBox("Opening hive file failed!");<br />
</pre><br />
of /boot/freeldr/freeldr/windows/wlregistry.c<br />
<br />
'''WinLdrLoadSystemHive()/3'''<br />
<pre><br />
BOOLEAN<br />
WinLdrLoadSystemHive(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock,<br />
IN LPCSTR DirectoryPath,<br />
IN LPCSTR HiveName)<br />
/* Concatenate path and filename to get the full name */<br />
strcpy(FullHiveName, DirectoryPath);<br />
strcat(FullHiveName, HiveName);<br />
//Print(L"Loading %s...\n", FullHiveName);<br />
Status = ArcOpen(FullHiveName, OpenReadOnly, &FileId);<br />
<br />
if (Status != ESUCCESS)<br />
{<br />
*** UiMessageBox("Opening hive file failed!");<br />
return FALSE;<br />
}<br />
</pre><br />
'''WinLdrScanSystemHive()''' calls '''WinLdrLoadSystemHive()'''<br />
<pre><br />
BOOLEAN WinLdrScanSystemHive()/2<br />
strcpy(SearchPath, DirectoryPath);<br />
strcat(SearchPath, "SYSTEM32\\CONFIG\\");<br />
Status = WinLdrLoadSystemHive(LoaderBlock, SearchPath, "SYSTEM");<br />
// Fail if failed...<br />
if (!Status) <br />
return FALSE;<br />
</pre><br />
<br />
== How bootcd is built ==<br />
<br />
Quote from \boot\CMakeLists.txt:<br />
<pre><br />
add_custom_target(bootcd<br />
COMMAND native-cdmake -j -m -b ${CMAKE_CURRENT_BINARY_DIR}/freeldr/bootsect/isoboot.bin \<br />
@${CMAKE_CURRENT_BINARY_DIR}/bootcd.lst REACTOS ${REACTOS_BINARY_DIR}/bootcd.iso<br />
DEPENDS native-cdmake<br />
VERBATIM)<br />
</pre><br />
CMAKE_CURRENT_BINARY_DIR = \output-MinGW-i386\reactos\boot<br />
<br />
'''How livecd is built:'''<br />
<br />
Quote from \boot\CMakeLists.txt:<br />
<pre><br />
add_custom_target(livecd<br />
COMMAND native-cdmake -j -m -b ${CMAKE_CURRENT_BINARY_DIR}/freeldr/bootsect/isoboot.bin \<br />
@${CMAKE_CURRENT_BINARY_DIR}/livecd.lst REACTOS ${REACTOS_BINARY_DIR}/livecd.iso<br />
DEPENDS native-cdmake<br />
VERBATIM)<br />
</pre><br />
<br />
'''How isoboot.bin file is built:'''<br />
<pre>CreateBootSectorTarget(isoboot ${CMAKE_CURRENT_SOURCE_DIR}/isoboot.S ${CMAKE_CURRENT_BINARY_DIR}/isoboot.bin 7000)<br />
</pre><br />
<br />
'''freeldr.sys on livecd:'''<br />
freeldr.sys on Livecd is renamed to setupldr.sys because isoboot.bin looks for setupldr.sys<br />
<br />
= ntoskrnl.exe loading and start =<br />
Entry point : _KiSystemStartup@4; subsystem:native</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna./FreeLoader,_bootcd_and_bootrecords&diff=34659User:Mna./FreeLoader, bootcd and bootrecords2014-03-25T10:34:18Z<p>Mna.: /* bootcd and FreeLoader during 1st stage setup */</p>
<hr />
<div>=FreeLoader freeldr Architecture=<br />
<br />
==FreeLoader Initialization==<br />
When FreeLoader gets control it <br />
* saves the boot drive, passed to it in the DL register, partition number passed in the DH register<br />
* sets up the stack, <br />
* enables protected mode, and <br />
* calls BootMain().<br />
--based on quote from \boot\freeldr\notes.txt<br />
<br />
==BootMain==<br />
VOID BootMain(LPSTR CmdLine) is layed in \boot\freeldr\freeldr\freeldr.c<br />
<br />
It is main Freeldr function:<br />
<br />
<pre><br />
VOID BootMain(LPSTR CmdLine)<br />
{<br />
CmdLineParse(CmdLine);<br />
MachInit(CmdLine);<br />
FsInit();<br />
DebugInit();<br />
TRACE("BootMain() called.\n");<br />
<br />
if (!UiInitialize(FALSE))<br />
{<br />
UiMessageBoxCritical("Unable to initialize UI.\n");<br />
goto quit;<br />
}<br />
if (!MmInitializeMemoryManager())<br />
{<br />
UiMessageBoxCritical("Unable to initialize memory manager");<br />
goto quit;<br />
}<br />
#ifdef _M_IX86<br />
HalpInitializePciStubs();<br />
HalpInitBusHandler();<br />
#endif<br />
RunLoader();<br />
<br />
quit:<br />
/* If we reach this point, something went wrong before, therefore reboot */<br />
DiskStopFloppyMotor();<br />
Reboot();<br />
}<br />
</pre><br />
<br />
\boot\freeldr\freeldr\debug.c : DebugInit()<br />
Initializes Rs232 port, among other things.<br />
<br />
==OS_LOADING_METHOD==<br />
'''BootMain'''() calls '''RunLoader'''() //bootmgr.c<br />
<br />
'''RunLoader'''() calls '''LoadOperatingSystem'''()<br />
<br />
'''LoadOperatingSystem'''() lookups the OS_LOADING_METHOD and calls found loading method.<br />
//\boot\freeldr\freeldr\bootmgr.c<br />
//VOID LoadOperatingSystem(IN OperatingSystemItem* OperatingSystem);<br />
<br />
OS_LOADING_METHOD is a function pointer field in the table of OSLoadingMethods (in bootmgr.c) :<br />
<pre><br />
typedef VOID (*OS_LOADING_METHOD)(IN OperatingSystemItem* OperatingSystem,<br />
IN USHORT OperatingSystemVersion);<br />
</pre><br />
Most used loading methods are: '''LoadAndBootWindows'''(), '''LoadReactOSSetup'''()<br />
// \boot\freeldr\freeldr\windows\ {winldr.c,setupldr.c}<br />
<br />
Windows2003/LoadAndBootWindows() is a normal/default loading method, called by installed ReactOS.<br />
ReactOSSetup/LoadReactOSSetup() is a method called by ReactOS bootcd installer ''usetup.exe''.<br />
<br />
List of all ReactOS loading methods:<br />
<pre><br />
{"ReactOSSetup", 0 , LoadReactOSSetup },<br />
#ifdef _M_IX86<br />
{"BootSector" , 0 , LoadAndBootBootSector},<br />
{"Drive" , 0 , LoadAndBootDrive },<br />
{"Partition" , 0 , LoadAndBootPartition },<br />
<br />
{"Linux" , 0 , LoadAndBootLinux },<br />
<br />
{"Windows" , 0 , LoadAndBootWindows },<br />
{"WindowsNT40" , _WIN32_WINNT_NT4 , LoadAndBootWindows },<br />
#endif<br />
{"Windows2003" , _WIN32_WINNT_WS03, LoadAndBootWindows },<br />
</pre><br />
<br />
== DoOptionsMenu() ==<br />
Options menu is activated by pressing F8 key.<br />
<br />
RunLoader() checks keys and activates; calls DoOptionsMenu() (options.c)<br />
<br />
=FreeLoader loading=<br />
freeldr.sys is started by some type of BootRecord (BR): MBR, VBR, CD boot sector.<br />
<br />
==How bootcd installer usetup.exe writes MBR==<br />
When installing the ReactOS some component should write MBR/VBR to let freeldr.sys start at boot time.<br />
<br />
This is done by usetup.exe : <br />
* BootLoaderHarddiskMbrPage(&Ir) and its helpers: <br />
** InstallMbrBootCodeToDisk()/2 and <br />
** InstallVBRToPartition()/4.<br />
*** InstallFatBootcodeToPartition()/4<br />
<br />
<pre><br />
/** Side note related with bug in usetup.exe -bug writing MBR/VBR in some (frequent) cases: */<br />
<br />
MBRInstallType: usetup.exe variable keeps Boot Record installation mode:<br />
0-None (skip installation) 1-floppy MBR 2-Hdd MBR & VBR <br />
Files:<br />
/base/setup/reactos/ reactos.c : struct SetupData has field MBRInstallType<br />
/base/setup/usetup/interface/ usetup.c : use of MBRInstallType data.<br />
</pre><br />
<br />
'''usetup.exe''' : Page '''''BOOT_LOADER_HARDDISK_MBR_PAGE''''' is handled by: BootLoaderHarddiskMbrPage(&Ir);<br />
( @/base/setup/usetup/interface/usetup.c)<br />
<br />
'''BootLoaderHarddiskMbrPage''' function creates/writes MBR and VBR records.<br />
<br />
''/*** So the main errors are here: This function somehow is not called or the call/subcalls are failed. */''<br />
<br />
<pre><br />
BootLoaderHarddiskMbrPage(&Ir);<br />
/* Step 1: Write the VBR */<br />
InstallVBRToPartition()/4<br />
if (!NT_SUCCESS(Status)) {<br />
MUIDisplayError(ERROR_WRITE_BOOT, Ir, POPUP_WAIT_ENTER);<br />
return QUIT_PAGE;<br />
}<br />
/* Step 2: Write the MBR */<br />
writes bootcd '\loader\dosmbr.bin' into the MBR-place<br />
</pre><br />
<br />
'''InstallVBRToPartition'''/4 (@/base/setup/usetup/bootsup.c)<br />
<pre><br />
InstallVBRToPartition():<br />
if (PartitionType is FAT_PartitionType )<br />
return InstallFatBootcodeToPartition/4<br />
else return STATUS_UNSUCCESSFUL;<br />
</pre><br />
<br />
{| class="wikitable"<br />
|-<br />
! FAT_PartitionType <br />
|-<br />
| PARTITION_FAT_12<br />
|-<br />
| PARTITION_FAT_16<br />
|-<br />
| PARTITION_HUGE<br />
|-<br />
| PARTITION_XINT13<br />
|-<br />
| PARTITION_FAT32<br />
|-<br />
| PARTITION_FAT32_XINT13<br />
|}<br />
<br />
'''InstallFatBootcodeToPartition'''()/4:<br />
<br />
Copies original bootsector file to: %DEST%''\bootsect.ros'' file.<br />
{| class="wikitable"<br />
|-<br />
! FS ID/PartitionType !! Freeloader boot sector binary original name !! Source file name<br />
|-<br />
| FAT32: PARTITION_FAT32, PARTITION_FAT32_XINT13|| fat32.bin || fat32.S<br />
|-<br />
| FAT16: ''else''-branche of ''if''|| fat.bin || fat.S<br />
|-<br />
| otherwise something is failed|| - || -<br />
|}<br />
<br />
'''Legacy''': Also there is a (pretty old,circa 2001) component in ReactOS source: '''''installfreeldr''''' (source: /boot/freeldr/install; binary: unknown). It writes FAT32 MBR only.<br />
<br />
==Boot record types (MBR, VBR, boot sectors, boot records of boot cd/livecd==<br />
TBW: ''InstallFatBootcodeToPartition''-sourced + others (isoboot + ext2(?) etc)<br />
<br />
Parameters boot record passes to FreeLdr: (fat32 & cdrom) (?fat16 doesn't pass DH?)<br />
* boot drive number in DL register. It is BIOS drive number: 0x80 is the 1st drive, 0x81 - 2nd etc.<br />
* boot partition number (0-based) in DH register (0 for CDROM)<br />
<br />
=bootcd and FreeLoader during 1st stage setup=<br />
* ''Note: ReactOS 1st stage setup run by usetup.exe shouldn't be confused with 1st stage loading of (ReactOS or GRUB) bootloader. These are totally different things.''<br />
** ''GRUB loading stages are: 1st stage: loading the MBR, 1.5 stage (...), 2nd stage: running modules from grub host filesystem, from (hdX,msdosY)/boot/grub/i386-pc/*.mod''<br />
<br />
==usetup.exe==<br />
bootcd main installer module is a '''usetup.exe''' (@\base\setup\usetup\*)<br />
usetup.exe is:<br />
* nativecui module<br />
* Uses libraries: zlib, inflib, ext2lib, vfatlib<br />
<br />
==BootOptions of bootcd==<br />
<br />
BootOptions of bootcd are: '/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE'<br />
<pre><br />
// (../../boot/freeldr/freeldr/windows/setupldr.c:219) trace: BootOptions: '/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE'<br />
</pre><br />
Is read by LoadReactOSSetup(): by setup method of ntoskrnl-loader; designed for usetup.exe.<br />
<br />
Specified in: bootcd.ISO\reactos\txtsetup.sif : SetupData/[Dbg]OsLoadOptions :<br />
<pre><br />
{setupldr.c: InfFindFirstLine(InfHandle, "SetupData", "OsLoadOptions", &InfContext)<br />
or {<br />
{setupldr.c: InfFindFirstLine(InfHandle, "SetupData", "DbgOsLoadOptions", &InfContext)<br />
depending of DBG variable (DBG is now defined by default).<br />
</pre><br />
The source file copied to bootcd.ISO is: \boot\bootdata\txtsetup.sif<br />
<pre><br />
...<br />
[SetupData]<br />
DefaultPath = \ReactOS<br />
OsLoadOptions = "/NOGUIBOOT /NODEBUG"<br />
DbgOsLoadOptions = "/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE"<br />
...<br />
</pre><br />
<br />
== bootcd - Blue TextUI MessageBox "Opening hive file failed!" ==<br />
<br />
Blue TextUI MessageBox "Opening hive file failed!" <br />
<br />
Is a symptom of trying to run bootcd as normal reactos installation, with should has registry.<br />
<br />
bootcd hasn't any registry installed. (look for file: %Root%\SYSTEM32\CONFIG\SYSTEM)<br />
<pre><br />
wlregistry.c: UiMessageBox("Opening hive file failed!");<br />
</pre><br />
of /boot/freeldr/freeldr/windows/wlregistry.c<br />
<br />
'''WinLdrLoadSystemHive()/3'''<br />
<pre><br />
BOOLEAN<br />
WinLdrLoadSystemHive(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock,<br />
IN LPCSTR DirectoryPath,<br />
IN LPCSTR HiveName)<br />
/* Concatenate path and filename to get the full name */<br />
strcpy(FullHiveName, DirectoryPath);<br />
strcat(FullHiveName, HiveName);<br />
//Print(L"Loading %s...\n", FullHiveName);<br />
Status = ArcOpen(FullHiveName, OpenReadOnly, &FileId);<br />
<br />
if (Status != ESUCCESS)<br />
{<br />
*** UiMessageBox("Opening hive file failed!");<br />
return FALSE;<br />
}<br />
</pre><br />
'''WinLdrScanSystemHive()''' calls '''WinLdrLoadSystemHive()'''<br />
<pre><br />
BOOLEAN WinLdrScanSystemHive()/2<br />
strcpy(SearchPath, DirectoryPath);<br />
strcat(SearchPath, "SYSTEM32\\CONFIG\\");<br />
Status = WinLdrLoadSystemHive(LoaderBlock, SearchPath, "SYSTEM");<br />
// Fail if failed...<br />
if (!Status) <br />
return FALSE;<br />
</pre><br />
<br />
== How bootcd is built ==<br />
<br />
Quote from \boot\CMakeLists.txt:<br />
<pre><br />
add_custom_target(bootcd<br />
COMMAND native-cdmake -j -m -b ${CMAKE_CURRENT_BINARY_DIR}/freeldr/bootsect/isoboot.bin \<br />
@${CMAKE_CURRENT_BINARY_DIR}/bootcd.lst REACTOS ${REACTOS_BINARY_DIR}/bootcd.iso<br />
DEPENDS native-cdmake<br />
VERBATIM)<br />
</pre><br />
CMAKE_CURRENT_BINARY_DIR = \output-MinGW-i386\reactos\boot<br />
<br />
'''How livecd is built:'''<br />
<br />
Quote from \boot\CMakeLists.txt:<br />
<pre><br />
add_custom_target(livecd<br />
COMMAND native-cdmake -j -m -b ${CMAKE_CURRENT_BINARY_DIR}/freeldr/bootsect/isoboot.bin \<br />
@${CMAKE_CURRENT_BINARY_DIR}/livecd.lst REACTOS ${REACTOS_BINARY_DIR}/livecd.iso<br />
DEPENDS native-cdmake<br />
VERBATIM)<br />
</pre><br />
<br />
'''How isoboot.bin file is built:'''<br />
<pre>CreateBootSectorTarget(isoboot ${CMAKE_CURRENT_SOURCE_DIR}/isoboot.S ${CMAKE_CURRENT_BINARY_DIR}/isoboot.bin 7000)<br />
</pre><br />
<br />
'''freeldr.sys on livecd:'''<br />
freeldr.sys on Livecd is renamed to setupldr.sys because isoboot.bin looks for setupldr.sys<br />
<br />
= ntoskrnl.exe loading and start =<br />
Entry point : _KiSystemStartup@4; subsystem:native</div>Mna.https://reactos.org/wiki/index.php?title=User:Mna./FreeLoader,_bootcd_and_bootrecords&diff=34658User:Mna./FreeLoader, bootcd and bootrecords2014-03-25T10:33:24Z<p>Mna.: /* bootcd and FreeLoader during 1st stage setup */</p>
<hr />
<div>=FreeLoader freeldr Architecture=<br />
<br />
==FreeLoader Initialization==<br />
When FreeLoader gets control it <br />
* saves the boot drive, passed to it in the DL register, partition number passed in the DH register<br />
* sets up the stack, <br />
* enables protected mode, and <br />
* calls BootMain().<br />
--based on quote from \boot\freeldr\notes.txt<br />
<br />
==BootMain==<br />
VOID BootMain(LPSTR CmdLine) is layed in \boot\freeldr\freeldr\freeldr.c<br />
<br />
It is main Freeldr function:<br />
<br />
<pre><br />
VOID BootMain(LPSTR CmdLine)<br />
{<br />
CmdLineParse(CmdLine);<br />
MachInit(CmdLine);<br />
FsInit();<br />
DebugInit();<br />
TRACE("BootMain() called.\n");<br />
<br />
if (!UiInitialize(FALSE))<br />
{<br />
UiMessageBoxCritical("Unable to initialize UI.\n");<br />
goto quit;<br />
}<br />
if (!MmInitializeMemoryManager())<br />
{<br />
UiMessageBoxCritical("Unable to initialize memory manager");<br />
goto quit;<br />
}<br />
#ifdef _M_IX86<br />
HalpInitializePciStubs();<br />
HalpInitBusHandler();<br />
#endif<br />
RunLoader();<br />
<br />
quit:<br />
/* If we reach this point, something went wrong before, therefore reboot */<br />
DiskStopFloppyMotor();<br />
Reboot();<br />
}<br />
</pre><br />
<br />
\boot\freeldr\freeldr\debug.c : DebugInit()<br />
Initializes Rs232 port, among other things.<br />
<br />
==OS_LOADING_METHOD==<br />
'''BootMain'''() calls '''RunLoader'''() //bootmgr.c<br />
<br />
'''RunLoader'''() calls '''LoadOperatingSystem'''()<br />
<br />
'''LoadOperatingSystem'''() lookups the OS_LOADING_METHOD and calls found loading method.<br />
//\boot\freeldr\freeldr\bootmgr.c<br />
//VOID LoadOperatingSystem(IN OperatingSystemItem* OperatingSystem);<br />
<br />
OS_LOADING_METHOD is a function pointer field in the table of OSLoadingMethods (in bootmgr.c) :<br />
<pre><br />
typedef VOID (*OS_LOADING_METHOD)(IN OperatingSystemItem* OperatingSystem,<br />
IN USHORT OperatingSystemVersion);<br />
</pre><br />
Most used loading methods are: '''LoadAndBootWindows'''(), '''LoadReactOSSetup'''()<br />
// \boot\freeldr\freeldr\windows\ {winldr.c,setupldr.c}<br />
<br />
Windows2003/LoadAndBootWindows() is a normal/default loading method, called by installed ReactOS.<br />
ReactOSSetup/LoadReactOSSetup() is a method called by ReactOS bootcd installer ''usetup.exe''.<br />
<br />
List of all ReactOS loading methods:<br />
<pre><br />
{"ReactOSSetup", 0 , LoadReactOSSetup },<br />
#ifdef _M_IX86<br />
{"BootSector" , 0 , LoadAndBootBootSector},<br />
{"Drive" , 0 , LoadAndBootDrive },<br />
{"Partition" , 0 , LoadAndBootPartition },<br />
<br />
{"Linux" , 0 , LoadAndBootLinux },<br />
<br />
{"Windows" , 0 , LoadAndBootWindows },<br />
{"WindowsNT40" , _WIN32_WINNT_NT4 , LoadAndBootWindows },<br />
#endif<br />
{"Windows2003" , _WIN32_WINNT_WS03, LoadAndBootWindows },<br />
</pre><br />
<br />
== DoOptionsMenu() ==<br />
Options menu is activated by pressing F8 key.<br />
<br />
RunLoader() checks keys and activates; calls DoOptionsMenu() (options.c)<br />
<br />
=FreeLoader loading=<br />
freeldr.sys is started by some type of BootRecord (BR): MBR, VBR, CD boot sector.<br />
<br />
==How bootcd installer usetup.exe writes MBR==<br />
When installing the ReactOS some component should write MBR/VBR to let freeldr.sys start at boot time.<br />
<br />
This is done by usetup.exe : <br />
* BootLoaderHarddiskMbrPage(&Ir) and its helpers: <br />
** InstallMbrBootCodeToDisk()/2 and <br />
** InstallVBRToPartition()/4.<br />
*** InstallFatBootcodeToPartition()/4<br />
<br />
<pre><br />
/** Side note related with bug in usetup.exe -bug writing MBR/VBR in some (frequent) cases: */<br />
<br />
MBRInstallType: usetup.exe variable keeps Boot Record installation mode:<br />
0-None (skip installation) 1-floppy MBR 2-Hdd MBR & VBR <br />
Files:<br />
/base/setup/reactos/ reactos.c : struct SetupData has field MBRInstallType<br />
/base/setup/usetup/interface/ usetup.c : use of MBRInstallType data.<br />
</pre><br />
<br />
'''usetup.exe''' : Page '''''BOOT_LOADER_HARDDISK_MBR_PAGE''''' is handled by: BootLoaderHarddiskMbrPage(&Ir);<br />
( @/base/setup/usetup/interface/usetup.c)<br />
<br />
'''BootLoaderHarddiskMbrPage''' function creates/writes MBR and VBR records.<br />
<br />
''/*** So the main errors are here: This function somehow is not called or the call/subcalls are failed. */''<br />
<br />
<pre><br />
BootLoaderHarddiskMbrPage(&Ir);<br />
/* Step 1: Write the VBR */<br />
InstallVBRToPartition()/4<br />
if (!NT_SUCCESS(Status)) {<br />
MUIDisplayError(ERROR_WRITE_BOOT, Ir, POPUP_WAIT_ENTER);<br />
return QUIT_PAGE;<br />
}<br />
/* Step 2: Write the MBR */<br />
writes bootcd '\loader\dosmbr.bin' into the MBR-place<br />
</pre><br />
<br />
'''InstallVBRToPartition'''/4 (@/base/setup/usetup/bootsup.c)<br />
<pre><br />
InstallVBRToPartition():<br />
if (PartitionType is FAT_PartitionType )<br />
return InstallFatBootcodeToPartition/4<br />
else return STATUS_UNSUCCESSFUL;<br />
</pre><br />
<br />
{| class="wikitable"<br />
|-<br />
! FAT_PartitionType <br />
|-<br />
| PARTITION_FAT_12<br />
|-<br />
| PARTITION_FAT_16<br />
|-<br />
| PARTITION_HUGE<br />
|-<br />
| PARTITION_XINT13<br />
|-<br />
| PARTITION_FAT32<br />
|-<br />
| PARTITION_FAT32_XINT13<br />
|}<br />
<br />
'''InstallFatBootcodeToPartition'''()/4:<br />
<br />
Copies original bootsector file to: %DEST%''\bootsect.ros'' file.<br />
{| class="wikitable"<br />
|-<br />
! FS ID/PartitionType !! Freeloader boot sector binary original name !! Source file name<br />
|-<br />
| FAT32: PARTITION_FAT32, PARTITION_FAT32_XINT13|| fat32.bin || fat32.S<br />
|-<br />
| FAT16: ''else''-branche of ''if''|| fat.bin || fat.S<br />
|-<br />
| otherwise something is failed|| - || -<br />
|}<br />
<br />
'''Legacy''': Also there is a (pretty old,circa 2001) component in ReactOS source: '''''installfreeldr''''' (source: /boot/freeldr/install; binary: unknown). It writes FAT32 MBR only.<br />
<br />
==Boot record types (MBR, VBR, boot sectors, boot records of boot cd/livecd==<br />
TBW: ''InstallFatBootcodeToPartition''-sourced + others (isoboot + ext2(?) etc)<br />
<br />
Parameters boot record passes to FreeLdr: (fat32 & cdrom) (?fat16 doesn't pass DH?)<br />
* boot drive number in DL register. It is BIOS drive number: 0x80 is the 1st drive, 0x81 - 2nd etc.<br />
* boot partition number (0-based) in DH register (0 for CDROM)<br />
<br />
=bootcd and FreeLoader during 1st stage setup=<br />
* ''Note: ReactOS 1st stage setup run by usetup.exe shouldn't be confused with 1st stage loading of (ReactOS or GRUB) bootloader. These are totally different things.''<br />
** ''GRUB loading stages are: 1st stage: loading the MBR, 1.5 stage (...), 2 stage: running modules from grub host filesystem, at (hdX,msdosY)/boot/grub/i386-pc/*.mod''<br />
<br />
==usetup.exe==<br />
bootcd main installer module is a '''usetup.exe''' (@\base\setup\usetup\*)<br />
usetup.exe is:<br />
* nativecui module<br />
* Uses libraries: zlib, inflib, ext2lib, vfatlib<br />
<br />
==BootOptions of bootcd==<br />
<br />
BootOptions of bootcd are: '/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE'<br />
<pre><br />
// (../../boot/freeldr/freeldr/windows/setupldr.c:219) trace: BootOptions: '/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE'<br />
</pre><br />
Is read by LoadReactOSSetup(): by setup method of ntoskrnl-loader; designed for usetup.exe.<br />
<br />
Specified in: bootcd.ISO\reactos\txtsetup.sif : SetupData/[Dbg]OsLoadOptions :<br />
<pre><br />
{setupldr.c: InfFindFirstLine(InfHandle, "SetupData", "OsLoadOptions", &InfContext)<br />
or {<br />
{setupldr.c: InfFindFirstLine(InfHandle, "SetupData", "DbgOsLoadOptions", &InfContext)<br />
depending of DBG variable (DBG is now defined by default).<br />
</pre><br />
The source file copied to bootcd.ISO is: \boot\bootdata\txtsetup.sif<br />
<pre><br />
...<br />
[SetupData]<br />
DefaultPath = \ReactOS<br />
OsLoadOptions = "/NOGUIBOOT /NODEBUG"<br />
DbgOsLoadOptions = "/NOGUIBOOT /KDSERIAL /DEBUGPORT=COM1 /FIRSTCHANCE"<br />
...<br />
</pre><br />
<br />
== bootcd - Blue TextUI MessageBox "Opening hive file failed!" ==<br />
<br />
Blue TextUI MessageBox "Opening hive file failed!" <br />
<br />
Is a symptom of trying to run bootcd as normal reactos installation, with should has registry.<br />
<br />
bootcd hasn't any registry installed. (look for file: %Root%\SYSTEM32\CONFIG\SYSTEM)<br />
<pre><br />
wlregistry.c: UiMessageBox("Opening hive file failed!");<br />
</pre><br />
of /boot/freeldr/freeldr/windows/wlregistry.c<br />
<br />
'''WinLdrLoadSystemHive()/3'''<br />
<pre><br />
BOOLEAN<br />
WinLdrLoadSystemHive(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock,<br />
IN LPCSTR DirectoryPath,<br />
IN LPCSTR HiveName)<br />
/* Concatenate path and filename to get the full name */<br />
strcpy(FullHiveName, DirectoryPath);<br />
strcat(FullHiveName, HiveName);<br />
//Print(L"Loading %s...\n", FullHiveName);<br />
Status = ArcOpen(FullHiveName, OpenReadOnly, &FileId);<br />
<br />
if (Status != ESUCCESS)<br />
{<br />
*** UiMessageBox("Opening hive file failed!");<br />
return FALSE;<br />
}<br />
</pre><br />
'''WinLdrScanSystemHive()''' calls '''WinLdrLoadSystemHive()'''<br />
<pre><br />
BOOLEAN WinLdrScanSystemHive()/2<br />
strcpy(SearchPath, DirectoryPath);<br />
strcat(SearchPath, "SYSTEM32\\CONFIG\\");<br />
Status = WinLdrLoadSystemHive(LoaderBlock, SearchPath, "SYSTEM");<br />
// Fail if failed...<br />
if (!Status) <br />
return FALSE;<br />
</pre><br />
<br />
== How bootcd is built ==<br />
<br />
Quote from \boot\CMakeLists.txt:<br />
<pre><br />
add_custom_target(bootcd<br />
COMMAND native-cdmake -j -m -b ${CMAKE_CURRENT_BINARY_DIR}/freeldr/bootsect/isoboot.bin \<br />
@${CMAKE_CURRENT_BINARY_DIR}/bootcd.lst REACTOS ${REACTOS_BINARY_DIR}/bootcd.iso<br />
DEPENDS native-cdmake<br />
VERBATIM)<br />
</pre><br />
CMAKE_CURRENT_BINARY_DIR = \output-MinGW-i386\reactos\boot<br />
<br />
'''How livecd is built:'''<br />
<br />
Quote from \boot\CMakeLists.txt:<br />
<pre><br />
add_custom_target(livecd<br />
COMMAND native-cdmake -j -m -b ${CMAKE_CURRENT_BINARY_DIR}/freeldr/bootsect/isoboot.bin \<br />
@${CMAKE_CURRENT_BINARY_DIR}/livecd.lst REACTOS ${REACTOS_BINARY_DIR}/livecd.iso<br />
DEPENDS native-cdmake<br />
VERBATIM)<br />
</pre><br />
<br />
'''How isoboot.bin file is built:'''<br />
<pre>CreateBootSectorTarget(isoboot ${CMAKE_CURRENT_SOURCE_DIR}/isoboot.S ${CMAKE_CURRENT_BINARY_DIR}/isoboot.bin 7000)<br />
</pre><br />
<br />
'''freeldr.sys on livecd:'''<br />
freeldr.sys on Livecd is renamed to setupldr.sys because isoboot.bin looks for setupldr.sys<br />
<br />
= ntoskrnl.exe loading and start =<br />
Entry point : _KiSystemStartup@4; subsystem:native</div>Mna.