Fix remaining text file line endings in the tree. (#18)

Based on https://stackoverflow.com/a/1511273

Also enforce CRLF for all *.xml files in our tree, because they are distributed with ReactOS.
This commit is contained in:
Colin Finck 2017-10-06 15:00:36 +02:00 committed by GitHub
parent 3cd76b91b5
commit 950c86fb4c
305 changed files with 466133 additions and 466140 deletions

View file

@ -1,3 +1,3 @@
[autorun]
open=reactos\welcome.exe
icon=icon.ico
[autorun]
open=reactos\welcome.exe
icon=icon.ico

View file

@ -1,3 +1,3 @@
[autorun]
open=bootcd\reactos\welcome.exe
icon=icon.ico
[autorun]
open=bootcd\reactos\welcome.exe
icon=icon.ico

View file

@ -1,3 +1,3 @@
[autorun]
open=readme.txt
icon=icon.ico
[autorun]
open=readme.txt
icon=icon.ico

View file

@ -1,31 +1,31 @@
[FREELOADER]
DefaultOS=Setup
TimeOut=0
[Display]
TitleText=ReactOS Setup
StatusBarColor=Cyan
StatusBarTextColor=Black
BackdropTextColor=White
BackdropColor=Blue
BackdropFillStyle=Medium
TitleBoxTextColor=White
TitleBoxColor=Red
MessageBoxTextColor=White
MessageBoxColor=Blue
MenuTextColor=Gray
MenuColor=Black
TextColor=Gray
SelectedTextColor=Black
SelectedColor=Gray
ShowTime=No
MenuBox=No
CenterMenu=No
MinimalUI=Yes
TimeText=Seconds until highlighted choice will be started automatically:
[Operating Systems]
Setup="Setup"
[Setup]
BootType=ReactOSSetup
[FREELOADER]
DefaultOS=Setup
TimeOut=0
[Display]
TitleText=ReactOS Setup
StatusBarColor=Cyan
StatusBarTextColor=Black
BackdropTextColor=White
BackdropColor=Blue
BackdropFillStyle=Medium
TitleBoxTextColor=White
TitleBoxColor=Red
MessageBoxTextColor=White
MessageBoxColor=Blue
MenuTextColor=Gray
MenuColor=Black
TextColor=Gray
SelectedTextColor=Black
SelectedColor=Gray
ShowTime=No
MenuBox=No
CenterMenu=No
MinimalUI=Yes
TimeText=Seconds until highlighted choice will be started automatically:
[Operating Systems]
Setup="Setup"
[Setup]
BootType=ReactOSSetup

View file

@ -1,14 +1,14 @@
@ECHO OFF
set DRIVE=
for %%X in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (if exist %%X:\AHK-Tests set DRIVE=%%X)
if not defined DRIVE (
dbgprint "AHK Application testing suite not present, skipping."
exit /b 0
)
xcopy /Y /H /E %DRIVE%:\AHK-Tests\*.* %SystemRoot%\bin
REM Download Amine's rosautotest from svn
dwnl http://svn.reactos.org/amine/rosautotest.exe %SystemRoot%\system32\rosautotest.exe
dbgprint "....AHK Application testing suite added."
@ECHO OFF
set DRIVE=
for %%X in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (if exist %%X:\AHK-Tests set DRIVE=%%X)
if not defined DRIVE (
dbgprint "AHK Application testing suite not present, skipping."
exit /b 0
)
xcopy /Y /H /E %DRIVE%:\AHK-Tests\*.* %SystemRoot%\bin
REM Download Amine's rosautotest from svn
dwnl http://svn.reactos.org/amine/rosautotest.exe %SystemRoot%\system32\rosautotest.exe
dbgprint "....AHK Application testing suite added."

View file

@ -1,14 +1,14 @@
@echo off
set WINETEST_DEBUG=0
set WINETEST_PLATFORM=reactos
move C:\ReactOS\bin\redirtest1.dll C:\ReactOS\bin\kernel32test_versioned.dll
move C:\ReactOS\bin\testdata\redirtest2.dll C:\ReactOS\bin\testdata\kernel32test_versioned.dll
if exist "C:\ReactOS\bin\AHKAppTests.cmd" (
dbgprint "Preparing AHK Application testing suite."
call C:\ReactOS\bin\AHKAppTests.cmd
del C:\ReactOS\bin\AHKAppTests.cmd
)
dbgprint --process "ipconfig"
start rosautotest /r /s /n
@echo off
set WINETEST_DEBUG=0
set WINETEST_PLATFORM=reactos
move C:\ReactOS\bin\redirtest1.dll C:\ReactOS\bin\kernel32test_versioned.dll
move C:\ReactOS\bin\testdata\redirtest2.dll C:\ReactOS\bin\testdata\kernel32test_versioned.dll
if exist "C:\ReactOS\bin\AHKAppTests.cmd" (
dbgprint "Preparing AHK Application testing suite."
call C:\ReactOS\bin\AHKAppTests.cmd
del C:\ReactOS\bin\AHKAppTests.cmd
)
dbgprint --process "ipconfig"
start rosautotest /r /s /n

View file

@ -1,28 +1,28 @@
@echo off
ECHO
ECHO Installing Programs...
ECHO
REM ECHO
REM ECHO Installing Abiword
REM ECHO
REM START /WAIT abiword.exe
REM start /WAIT dbgprint.exe SYSREG_CHECKPOINT:ABIWORD_INSTALL_COMPLETE
REM ECHO
REM ECHO Installing OpenOffice
REM ECHO
REM START /WAIT openoffice.msi /Q
REM start /WAIT dbgprint.exe SYSREG_CHECKPOINT:OPENOFFICE_INSTALL_COMPLETE
ECHO
ECHO Informing Sysreg that we are done
ECHO
START C:\ReactOS\bin\dbgprint.exe SYSREG_CHECKPOINT:THIRDBOOT_COMPLETE
ECHO
ECHO Shutting down ReactOS
ECHO
START shutdown.exe shutdown
@echo off
ECHO
ECHO Installing Programs...
ECHO
REM ECHO
REM ECHO Installing Abiword
REM ECHO
REM START /WAIT abiword.exe
REM start /WAIT dbgprint.exe SYSREG_CHECKPOINT:ABIWORD_INSTALL_COMPLETE
REM ECHO
REM ECHO Installing OpenOffice
REM ECHO
REM START /WAIT openoffice.msi /Q
REM start /WAIT dbgprint.exe SYSREG_CHECKPOINT:OPENOFFICE_INSTALL_COMPLETE
ECHO
ECHO Informing Sysreg that we are done
ECHO
START C:\ReactOS\bin\dbgprint.exe SYSREG_CHECKPOINT:THIRDBOOT_COMPLETE
ECHO
ECHO Shutting down ReactOS
ECHO
START shutdown.exe shutdown

View file

@ -1,57 +1,57 @@
[Unattend]
Signature = "$ReactOS$"
; Set UnattendSetupEnabled to yes in order to get unattended setup working
; yes - unattend setup enabled
; no - unattend setup disabled
UnattendSetupEnabled = yes
; Install to \Device\Harddisk0\Partition1\ReactOS
DestinationDiskNumber = 0
DestinationPartitionNumber = 1
InstallationDirectory=ReactOS
; MBRInstallType=0 skips MBR installation
; MBRInstallType=1 install MBR on floppy
; MBRInstallType=2 install MBR on hdd
MBRInstallType=2
FullName="MyName"
;OrgName="MyOrg"
ComputerName="MYCOMPUTERNAME"
;AdminPassword="MyPassword"
; TimeZone is set GMT as default
TimeZoneIndex=85
; enable this setting to disable daylight saving changes
; DisableAutoDaylightTimeSet = 1
; enable this setting to format the selected partition
; 1 - format enabled
; 0 - format disabled
FormatPartition=1
; enable this setting to automatically create a partition
; during installation
; 1 - enabled
; 0 - disabled
AutoPartition = 1
; set this option to automatically
; specify language in 2nd mode setup
; see hivesys.inf for available languages
LocaleID = 409
; enable this section to automatically launch programs
; after 3rd boot
;
[GuiRunOnce]
%SystemRoot%\system32\cmd.exe /c "regtest.cmd"
[Display]
BitsPerPel = 16
XResolution = 800
YResolution = 600
VRefresh = 0
[Unattend]
Signature = "$ReactOS$"
; Set UnattendSetupEnabled to yes in order to get unattended setup working
; yes - unattend setup enabled
; no - unattend setup disabled
UnattendSetupEnabled = yes
; Install to \Device\Harddisk0\Partition1\ReactOS
DestinationDiskNumber = 0
DestinationPartitionNumber = 1
InstallationDirectory=ReactOS
; MBRInstallType=0 skips MBR installation
; MBRInstallType=1 install MBR on floppy
; MBRInstallType=2 install MBR on hdd
MBRInstallType=2
FullName="MyName"
;OrgName="MyOrg"
ComputerName="MYCOMPUTERNAME"
;AdminPassword="MyPassword"
; TimeZone is set GMT as default
TimeZoneIndex=85
; enable this setting to disable daylight saving changes
; DisableAutoDaylightTimeSet = 1
; enable this setting to format the selected partition
; 1 - format enabled
; 0 - format disabled
FormatPartition=1
; enable this setting to automatically create a partition
; during installation
; 1 - enabled
; 0 - disabled
AutoPartition = 1
; set this option to automatically
; specify language in 2nd mode setup
; see hivesys.inf for available languages
LocaleID = 409
; enable this section to automatically launch programs
; after 3rd boot
;
[GuiRunOnce]
%SystemRoot%\system32\cmd.exe /c "regtest.cmd"
[Display]
BitsPerPel = 16
XResolution = 800
YResolution = 600
VRefresh = 0

File diff suppressed because it is too large Load diff

View file

@ -1,51 +1,51 @@
[FREELOADER]
DefaultOS=LiveCD_Debug
TimeOut=5
[Display]
TitleText=ReactOS LiveCD
StatusBarColor=Cyan
StatusBarTextColor=Black
BackdropTextColor=White
BackdropColor=Blue
BackdropFillStyle=Medium
TitleBoxTextColor=White
TitleBoxColor=Red
MessageBoxTextColor=White
MessageBoxColor=Blue
MenuTextColor=Gray
MenuColor=Black
TextColor=Gray
SelectedTextColor=Black
SelectedColor=Gray
ShowTime=No
MenuBox=No
CenterMenu=No
MinimalUI=Yes
TimeText=Seconds until highlighted choice will be started automatically:
[Operating Systems]
LiveCD="LiveCD"
LiveCD_Debug="LiveCD (Debug)"
LiveCD_Screen="LiveCD (Screen)"
LiveCD_LogFile="LiveCD (Log file)"
[LiveCD]
BootType=Windows2003
SystemPath=\reactos
Options=/MININT
[LiveCD_Debug]
BootType=Windows2003
SystemPath=\reactos
Options=/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS /MININT
[LiveCD_Screen]
BootType=Windows2003
SystemPath=\reactos
Options=/DEBUG /DEBUGPORT=SCREEN /SOS /MININT
[LiveCD_LogFile]
BootType=Windows2003
SystemPath=\reactos
Options=/DEBUG /DEBUGPORT=FILE:\Device\HarddiskX\PartitionY\debug.log /SOS /MININT
[FREELOADER]
DefaultOS=LiveCD_Debug
TimeOut=5
[Display]
TitleText=ReactOS LiveCD
StatusBarColor=Cyan
StatusBarTextColor=Black
BackdropTextColor=White
BackdropColor=Blue
BackdropFillStyle=Medium
TitleBoxTextColor=White
TitleBoxColor=Red
MessageBoxTextColor=White
MessageBoxColor=Blue
MenuTextColor=Gray
MenuColor=Black
TextColor=Gray
SelectedTextColor=Black
SelectedColor=Gray
ShowTime=No
MenuBox=No
CenterMenu=No
MinimalUI=Yes
TimeText=Seconds until highlighted choice will be started automatically:
[Operating Systems]
LiveCD="LiveCD"
LiveCD_Debug="LiveCD (Debug)"
LiveCD_Screen="LiveCD (Screen)"
LiveCD_LogFile="LiveCD (Log file)"
[LiveCD]
BootType=Windows2003
SystemPath=\reactos
Options=/MININT
[LiveCD_Debug]
BootType=Windows2003
SystemPath=\reactos
Options=/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS /MININT
[LiveCD_Screen]
BootType=Windows2003
SystemPath=\reactos
Options=/DEBUG /DEBUGPORT=SCREEN /SOS /MININT
[LiveCD_LogFile]
BootType=Windows2003
SystemPath=\reactos
Options=/DEBUG /DEBUGPORT=FILE:\Device\HarddiskX\PartitionY\debug.log /SOS /MININT

View file

@ -1,77 +1,77 @@
========================
ReactOS™ Version 0.4.x
Updated August 31, 2016
========================
1. What is ReactOS?
-------------------
ReactOS™ is an Open Source effort to develop a quality operating system that is
compatible with applications and drivers written for the Microsoft® Windows™ NT
family of operating systems (NT4, 2000, XP, 2003, Vista, Seven).
More information is available at: https://www.reactos.org
2. Relationship with the WINE project
-------------------------------------
ReactOS has always intended to work with the WINE project to share as much
programming effort as possible. This mainly concerns User Mode DLLs and
still happens to a degree today. Other areas of cooperation lie in
applications and testing suites.
3. Future compatibility
-----------------------
The ReactOS project, although currently focused on Windows Server 2003
compatibility, is always keeping an eye toward compatibility with
Windows Vista and future Windows NT releases.
4. Supporting other System Applications
---------------------------------------
The Windows NT architecture allows for subsystems, as does the ReactOS
architecture. A subsystem is an implementation of the APIs of another
operating system, allowing ReactOS to run applications from other systems.
We are already looking at subsystems for: Java, OS/2, and DOS and possibly
others in the future.
5. Is ReactOS legal?
--------------------
Yes we are.
All the code of ReactOS has been written from scratch by our developers.
We go to great lengths to ensure that the code our developers create is clean,
same applies to the variety of methods we use to understand Windows internals,
including clean room reverse engineering, using existing documentation freely
available both in books and on the web, using extensive tests (tens of millions)
which apply black box engineering methods against both public and private APIs
exposed by the operating system.
6. Tutorials
------------
Developer and User Tutorials: https://www.reactos.org/wiki
The tutorials contain more information on the project, compiling and testing
ReactOS - amongst other topics. Contributors to the project are always welcome.
7. Frequently Asked Questions
-----------------------------
Some of your questions may be answered in: https://www.reactos.org/joining/faqs
In addition, the ReactOS forum: https://www.reactos.org/forum/ may contain
complementary, yet non-official, information.
8. Authors
----------
This document was originally written by Jason Filby (jasonfilby@yahoo.com)
and is now occasionally updated by various contributors.
========================
ReactOS™ Version 0.4.x
Updated August 31, 2016
========================
1. What is ReactOS?
-------------------
ReactOS™ is an Open Source effort to develop a quality operating system that is
compatible with applications and drivers written for the Microsoft® Windows™ NT
family of operating systems (NT4, 2000, XP, 2003, Vista, Seven).
More information is available at: https://www.reactos.org
2. Relationship with the WINE project
-------------------------------------
ReactOS has always intended to work with the WINE project to share as much
programming effort as possible. This mainly concerns User Mode DLLs and
still happens to a degree today. Other areas of cooperation lie in
applications and testing suites.
3. Future compatibility
-----------------------
The ReactOS project, although currently focused on Windows Server 2003
compatibility, is always keeping an eye toward compatibility with
Windows Vista and future Windows NT releases.
4. Supporting other System Applications
---------------------------------------
The Windows NT architecture allows for subsystems, as does the ReactOS
architecture. A subsystem is an implementation of the APIs of another
operating system, allowing ReactOS to run applications from other systems.
We are already looking at subsystems for: Java, OS/2, and DOS and possibly
others in the future.
5. Is ReactOS legal?
--------------------
Yes we are.
All the code of ReactOS has been written from scratch by our developers.
We go to great lengths to ensure that the code our developers create is clean,
same applies to the variety of methods we use to understand Windows internals,
including clean room reverse engineering, using existing documentation freely
available both in books and on the web, using extensive tests (tens of millions)
which apply black box engineering methods against both public and private APIs
exposed by the operating system.
6. Tutorials
------------
Developer and User Tutorials: https://www.reactos.org/wiki
The tutorials contain more information on the project, compiling and testing
ReactOS - amongst other topics. Contributors to the project are always welcome.
7. Frequently Asked Questions
-----------------------------
Some of your questions may be answered in: https://www.reactos.org/joining/faqs
In addition, the ReactOS forum: https://www.reactos.org/forum/ may contain
complementary, yet non-official, information.
8. Authors
----------
This document was originally written by Jason Filby (jasonfilby@yahoo.com)
and is now occasionally updated by various contributors.

View file

@ -1,225 +1,225 @@
// fathelp.S
// FAT12/16 Boot Sector Helper Code
// Copyright (c) 1998, 2001, 2002, 2003 Brian Palmer
//#include <asm.inc>
//org 8000h
//.text
#define BootSectorStackTop HEX(7bf2)
#define DataAreaStartHigh 2
#define DataAreaStartLow 4
#define BiosCHSDriveSizeHigh 6
#define BiosCHSDriveSizeLow 8
#define BiosCHSDriveSize 8
#define ReadSectorsOffset 10
#define ReadClusterOffset 12
#define PutCharsOffset 14
#define OEMName 3
#define BytesPerSector 11
#define SectsPerCluster 13
#define ReservedSectors 14
#define NumberOfFats 16
#define MaxRootEntries 17
#define TotalSectors 19
#define MediaDescriptor 21
#define SectorsPerFat 22
#define SectorsPerTrack 24
#define NumberOfHeads 26
#define HiddenSectors 28
#define TotalSectorsBig 32
#define BootDrive 36
#define Reserved 37
#define ExtendSig 38
#define SerialNumber 39
#define VolumeLabel 43
#define FileSystem 54
#define BootPartition HEX(7dfd)
// This code will be stored in the first 512 bytes
// of freeldr.sys. The first 3 bytes will be a jmp
// instruction to skip past the FAT helper code
// that is stored in the rest of the 512 bytes.
//
PUBLIC start
start:
// This code is loaded at 0000:F800 so we have to
// encode a jmp instruction to jump to 0000:FA00
.byte HEX(e9), HEX(fd), HEX(01)
// Now starts the extra boot code that we will store
// in the first 512 bytes of freeldr.sys. This code
// allows the FAT12/16 bootsector to navigate the
// FAT table so that we can still load freeldr.sys
// even if it is fragmented.
FatHelperEntryPoint:
/* First save AX - the start cluster of freeldr.sys */
push ax
/* Display "Loading FreeLoader..." message */
mov si, offset msgLoading
call word ptr [bp-PutCharsOffset]
call ReadFatIntoMemory
/* Restore AX (start cluster) */
pop ax
// AX has start cluster of freeldr.sys
mov bx, FREELDR_BASE / 16
mov es,bx
LoadFile:
push ax
call IsFat12
pop ax
jnc LoadFile2
cmp ax, HEX(0ff8) // Check to see if this is the last cluster in the chain
jmp LoadFile3
LoadFile2:
cmp ax, HEX(0fff8)
LoadFile3:
jae LoadFile_Done // If so continue, if not then read then next one
push ax
xor bx,bx // Load ROSLDR starting at 0000:8000h
push es
call word ptr [bp-ReadClusterOffset]
pop es
xor bx,bx
mov bl, [bp+SectsPerCluster]
shl bx,5 // BX = BX * 512 / 16
mov ax,es // Increment the load address by
add ax,bx // The size of a cluster
mov es,ax
call IsFat12
pop ax
push es
jnc LoadFile4
call GetFatEntry12 // Get the next entry
jmp LoadFile5
LoadFile4:
call GetFatEntry16
LoadFile5:
pop es
jmp LoadFile // Load the next cluster (if any)
LoadFile_Done:
mov dl, byte ptr [bp+BootDrive] // Load the boot drive into DL
mov dh, byte ptr ds:[BootPartition] // Load the boot partition into DH
/* continue where other bootsectors start */
jmp start
// Reads the entire FAT into memory at 7000:0000
ReadFatIntoMemory:
mov ax, [bp+HiddenSectors]
mov dx, [bp+HiddenSectors+2]
add ax, [bp+ReservedSectors]
adc dx, 0
mov cx, [bp+SectorsPerFat]
mov bx, HEX(7000)
mov es,bx
xor bx,bx
call word ptr [bp-ReadSectorsOffset]
ret
// Returns the FAT entry for a given cluster number for 16-bit FAT
// On entry AX has cluster number
// On return AX has FAT entry for that cluster
GetFatEntry16:
mov cx,2 // AX = AX * 2 (since FAT16 entries are 2 bytes)
mul cx
shl dx,12
mov bx, HEX(7000)
add bx,dx
mov es,bx
mov bx,ax // Restore FAT entry offset
mov ax, es:[bx] // Get FAT entry
ret
// Returns the FAT entry for a given cluster number for 12-bit FAT
// On entry AX has cluster number
// On return AX has FAT entry for that cluster
GetFatEntry12:
push ax
mov cx,ax
shr ax,1
add ax,cx // AX = AX * 1.5 (AX = AX + (AX / 2)) (since FAT12 entries are 12 bits)
mov bx, HEX(7000)
mov es,bx
mov bx,ax // Put FAT entry offset into BX
mov ax, es:[bx] // Get FAT entry
pop cx // Get cluster number from stack
and cx,1
jz UseLow12Bits
and ax, HEX(0fff0)
shr ax,4
jmp GetFatEntry12_Done
UseLow12Bits:
and ax, HEX(0fff)
GetFatEntry12_Done:
ret
// Returns CF = 1 if this is a FAT12 file system
// Otherwise CF = 0 for FAT16
IsFat12:
mov ebx, dword ptr [bp-DataAreaStartLow]
// EBX now has the number of the starting sector of the data area
// starting from the beginning of the disk, so subtrace hidden sectors
sub ebx, dword ptr [bp+HiddenSectors]
xor eax,eax
mov ax, word ptr [bp+TotalSectors]
cmp ax, 0
jnz IsFat12_2
mov eax, dword ptr [bp+TotalSectorsBig]
// EAX now contains the number of sectors on the volume
IsFat12_2:
sub eax,ebx // Subtract data area start sector
xor edx,edx // from total sectors of volume
// EDX:EAX now contains the number of data sectors on the volume
movzx ebx, byte ptr [bp+SectsPerCluster]
div ebx
// EAX now has the number of clusters on the volume
stc
cmp eax,4085
jb IsFat12_Done
clc
IsFat12_Done:
ret
msgLoading:
.ascii "Loading FreeLoader...", CR, LF, NUL
.org 510 // Pad to 510 bytes
.word HEX(0aa55) // BootSector signature
// fathelp.S
// FAT12/16 Boot Sector Helper Code
// Copyright (c) 1998, 2001, 2002, 2003 Brian Palmer
//#include <asm.inc>
//org 8000h
//.text
#define BootSectorStackTop HEX(7bf2)
#define DataAreaStartHigh 2
#define DataAreaStartLow 4
#define BiosCHSDriveSizeHigh 6
#define BiosCHSDriveSizeLow 8
#define BiosCHSDriveSize 8
#define ReadSectorsOffset 10
#define ReadClusterOffset 12
#define PutCharsOffset 14
#define OEMName 3
#define BytesPerSector 11
#define SectsPerCluster 13
#define ReservedSectors 14
#define NumberOfFats 16
#define MaxRootEntries 17
#define TotalSectors 19
#define MediaDescriptor 21
#define SectorsPerFat 22
#define SectorsPerTrack 24
#define NumberOfHeads 26
#define HiddenSectors 28
#define TotalSectorsBig 32
#define BootDrive 36
#define Reserved 37
#define ExtendSig 38
#define SerialNumber 39
#define VolumeLabel 43
#define FileSystem 54
#define BootPartition HEX(7dfd)
// This code will be stored in the first 512 bytes
// of freeldr.sys. The first 3 bytes will be a jmp
// instruction to skip past the FAT helper code
// that is stored in the rest of the 512 bytes.
//
PUBLIC start
start:
// This code is loaded at 0000:F800 so we have to
// encode a jmp instruction to jump to 0000:FA00
.byte HEX(e9), HEX(fd), HEX(01)
// Now starts the extra boot code that we will store
// in the first 512 bytes of freeldr.sys. This code
// allows the FAT12/16 bootsector to navigate the
// FAT table so that we can still load freeldr.sys
// even if it is fragmented.
FatHelperEntryPoint:
/* First save AX - the start cluster of freeldr.sys */
push ax
/* Display "Loading FreeLoader..." message */
mov si, offset msgLoading
call word ptr [bp-PutCharsOffset]
call ReadFatIntoMemory
/* Restore AX (start cluster) */
pop ax
// AX has start cluster of freeldr.sys
mov bx, FREELDR_BASE / 16
mov es,bx
LoadFile:
push ax
call IsFat12
pop ax
jnc LoadFile2
cmp ax, HEX(0ff8) // Check to see if this is the last cluster in the chain
jmp LoadFile3
LoadFile2:
cmp ax, HEX(0fff8)
LoadFile3:
jae LoadFile_Done // If so continue, if not then read then next one
push ax
xor bx,bx // Load ROSLDR starting at 0000:8000h
push es
call word ptr [bp-ReadClusterOffset]
pop es
xor bx,bx
mov bl, [bp+SectsPerCluster]
shl bx,5 // BX = BX * 512 / 16
mov ax,es // Increment the load address by
add ax,bx // The size of a cluster
mov es,ax
call IsFat12
pop ax
push es
jnc LoadFile4
call GetFatEntry12 // Get the next entry
jmp LoadFile5
LoadFile4:
call GetFatEntry16
LoadFile5:
pop es
jmp LoadFile // Load the next cluster (if any)
LoadFile_Done:
mov dl, byte ptr [bp+BootDrive] // Load the boot drive into DL
mov dh, byte ptr ds:[BootPartition] // Load the boot partition into DH
/* continue where other bootsectors start */
jmp start
// Reads the entire FAT into memory at 7000:0000
ReadFatIntoMemory:
mov ax, [bp+HiddenSectors]
mov dx, [bp+HiddenSectors+2]
add ax, [bp+ReservedSectors]
adc dx, 0
mov cx, [bp+SectorsPerFat]
mov bx, HEX(7000)
mov es,bx
xor bx,bx
call word ptr [bp-ReadSectorsOffset]
ret
// Returns the FAT entry for a given cluster number for 16-bit FAT
// On entry AX has cluster number
// On return AX has FAT entry for that cluster
GetFatEntry16:
mov cx,2 // AX = AX * 2 (since FAT16 entries are 2 bytes)
mul cx
shl dx,12
mov bx, HEX(7000)
add bx,dx
mov es,bx
mov bx,ax // Restore FAT entry offset
mov ax, es:[bx] // Get FAT entry
ret
// Returns the FAT entry for a given cluster number for 12-bit FAT
// On entry AX has cluster number
// On return AX has FAT entry for that cluster
GetFatEntry12:
push ax
mov cx,ax
shr ax,1
add ax,cx // AX = AX * 1.5 (AX = AX + (AX / 2)) (since FAT12 entries are 12 bits)
mov bx, HEX(7000)
mov es,bx
mov bx,ax // Put FAT entry offset into BX
mov ax, es:[bx] // Get FAT entry
pop cx // Get cluster number from stack
and cx,1
jz UseLow12Bits
and ax, HEX(0fff0)
shr ax,4
jmp GetFatEntry12_Done
UseLow12Bits:
and ax, HEX(0fff)
GetFatEntry12_Done:
ret
// Returns CF = 1 if this is a FAT12 file system
// Otherwise CF = 0 for FAT16
IsFat12:
mov ebx, dword ptr [bp-DataAreaStartLow]
// EBX now has the number of the starting sector of the data area
// starting from the beginning of the disk, so subtrace hidden sectors
sub ebx, dword ptr [bp+HiddenSectors]
xor eax,eax
mov ax, word ptr [bp+TotalSectors]
cmp ax, 0
jnz IsFat12_2
mov eax, dword ptr [bp+TotalSectorsBig]
// EAX now contains the number of sectors on the volume
IsFat12_2:
sub eax,ebx // Subtract data area start sector
xor edx,edx // from total sectors of volume
// EDX:EAX now contains the number of data sectors on the volume
movzx ebx, byte ptr [bp+SectsPerCluster]
div ebx
// EAX now has the number of clusters on the volume
stc
cmp eax,4085
jb IsFat12_Done
clc
IsFat12_Done:
ret
msgLoading:
.ascii "Loading FreeLoader...", CR, LF, NUL
.org 510 // Pad to 510 bytes
.word HEX(0aa55) // BootSector signature

View file

@ -1,117 +1,117 @@
Empty8042:
.word HEX(00eb), HEX(00eb) // jmp $+2, jmp $+2
in al, HEX(64)
cmp al, HEX(0ff) // legacy-free machine without keyboard
jz Empty8042_ret // controllers on Intel Macs read back 0xFF
test al, 2
jnz Empty8042
Empty8042_ret:
ret
EnableA20:
pusha
call Empty8042
mov al, HEX(0D1) // command write
out HEX(064), al
call Empty8042
mov al, HEX(0DF) // A20 on
out HEX(060), al
call Empty8042
popa
ret
/*
* writestr
* si = pointer to zero terminated string
*/
writestr:
pushfd
pushad
writestr_top:
lodsb
and al, al
jz writestr_end
call writechr
jmp short writestr_top
writestr_end:
popad
popfd
ret
/*
* writechr
* al = character to output
*/
writechr:
pushf
pusha
mov ah, HEX(0E)
xor bx, bx
int HEX(10)
popa
popf
ret
//
// writehex[248]: Write a hex number in (AL, AX, EAX) to the console
//
writehex2:
pushfd
pushad
shl eax, 24
mov cx, 2
jmp short writehex_common
writehex4:
pushfd
pushad
shl eax, 16
mov cx, 4
jmp short writehex_common
writehex8:
pushfd
pushad
mov cx, 8
writehex_common:
.loop:
rol eax, 4
push eax
and al, HEX(0F)
cmp al, 10
jae .high
.low:
add al, '0'
jmp short .ischar
.high:
add al, 'A'-10
.ischar:
call writechr
pop eax
loop .loop
popad
popfd
ret
Reboot:
cli
/* Set the word at location 40h:72h to 0 (cold reboot) */
mov word ptr ds:[HEX(0472)], HEX(0)
/* and jump to location F000h:FFF0h in ROM */
ljmp16 HEX(0F000), HEX(0FFF0)
ChainLoadBiosBootSectorCode:
/* Load segment registers */
cli
xor ax, ax
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ss, ax
mov esp, HEX(7C00)
/* Jump to the bootsector code */
ljmp16 HEX(0000), HEX(7C00)
Empty8042:
.word HEX(00eb), HEX(00eb) // jmp $+2, jmp $+2
in al, HEX(64)
cmp al, HEX(0ff) // legacy-free machine without keyboard
jz Empty8042_ret // controllers on Intel Macs read back 0xFF
test al, 2
jnz Empty8042
Empty8042_ret:
ret
EnableA20:
pusha
call Empty8042
mov al, HEX(0D1) // command write
out HEX(064), al
call Empty8042
mov al, HEX(0DF) // A20 on
out HEX(060), al
call Empty8042
popa
ret
/*
* writestr
* si = pointer to zero terminated string
*/
writestr:
pushfd
pushad
writestr_top:
lodsb
and al, al
jz writestr_end
call writechr
jmp short writestr_top
writestr_end:
popad
popfd
ret
/*
* writechr
* al = character to output
*/
writechr:
pushf
pusha
mov ah, HEX(0E)
xor bx, bx
int HEX(10)
popa
popf
ret
//
// writehex[248]: Write a hex number in (AL, AX, EAX) to the console
//
writehex2:
pushfd
pushad
shl eax, 24
mov cx, 2
jmp short writehex_common
writehex4:
pushfd
pushad
shl eax, 16
mov cx, 4
jmp short writehex_common
writehex8:
pushfd
pushad
mov cx, 8
writehex_common:
.loop:
rol eax, 4
push eax
and al, HEX(0F)
cmp al, 10
jae .high
.low:
add al, '0'
jmp short .ischar
.high:
add al, 'A'-10
.ischar:
call writechr
pop eax
loop .loop
popad
popfd
ret
Reboot:
cli
/* Set the word at location 40h:72h to 0 (cold reboot) */
mov word ptr ds:[HEX(0472)], HEX(0)
/* and jump to location F000h:FFF0h in ROM */
ljmp16 HEX(0F000), HEX(0FFF0)
ChainLoadBiosBootSectorCode:
/* Load segment registers */
cli
xor ax, ax
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ss, ax
mov esp, HEX(7C00)
/* Jump to the bootsector code */
ljmp16 HEX(0000), HEX(7C00)

View file

@ -1,88 +1,88 @@
#include "../../include/arch/pc/pcbios.h"
#define EFLAGS_CF HEX(01)
#define EFLAGS_ZF HEX(40)
#define EFLAGS_SF HEX(80)
Int386:
/* Save all registers + segment registers */
push ds
push es
push fs
push gs
pushad
/* Get the interrupt vector and patch the opcode */
mov al, byte ptr ds:[BSS_IntVector]
mov byte ptr ds:[Int386_vector_opcode], al
/* Get current EFLAGS and mask CF, ZF and SF */
pushf
pop cx
and cx, not (EFLAGS_CF or EFLAGS_ZF or EFLAGS_SF)
/* Get flags CF, ZF and SF from the REGS structure */
mov ax, word ptr cs:[BSS_RegisterSet + REGS_EFLAGS]
and ax, (EFLAGS_CF or EFLAGS_ZF or EFLAGS_SF)
/* Combine flags and set them */
or ax, cx
push ax
popf
/* Setup the registers */
mov ax, word ptr cs:[BSS_RegisterSet + REGS_DS]
mov ds, ax
mov ax, word ptr cs:[BSS_RegisterSet + REGS_ES]
mov es, ax
mov ax, word ptr cs:[BSS_RegisterSet + REGS_FS]
mov fs, ax
mov ax, word ptr cs:[BSS_RegisterSet + REGS_GS]
mov gs, ax
mov eax, dword ptr cs:[BSS_RegisterSet + REGS_EAX]
mov ebx, dword ptr cs:[BSS_RegisterSet + REGS_EBX]
mov ecx, dword ptr cs:[BSS_RegisterSet + REGS_ECX]
mov edx, dword ptr cs:[BSS_RegisterSet + REGS_EDX]
mov esi, dword ptr cs:[BSS_RegisterSet + REGS_ESI]
mov edi, dword ptr cs:[BSS_RegisterSet + REGS_EDI]
// Don't setup ebp, we only use it as output!
/* Call the interrupt vector */
/*int Int386_vector*/
.byte HEX(0cd)
Int386_vector_opcode:
.byte 00
/* Save the registers */
mov dword ptr cs:[BSS_RegisterSet + REGS_EAX], eax
mov dword ptr cs:[BSS_RegisterSet + REGS_EBX], ebx
mov dword ptr cs:[BSS_RegisterSet + REGS_ECX], ecx
mov dword ptr cs:[BSS_RegisterSet + REGS_EDX], edx
mov dword ptr cs:[BSS_RegisterSet + REGS_ESI], esi
mov dword ptr cs:[BSS_RegisterSet + REGS_EDI], edi
mov dword ptr cs:[BSS_RegisterSet + REGS_EBP], ebp
mov ax, ds
mov word ptr cs:[BSS_RegisterSet + REGS_DS], ax
mov ax, es
mov word ptr cs:[BSS_RegisterSet + REGS_ES], ax
mov ax, fs
mov word ptr cs:[BSS_RegisterSet + REGS_FS], ax
mov ax, gs
mov word ptr cs:[BSS_RegisterSet + REGS_GS], ax
pushfd
pop dword ptr cs:[BSS_RegisterSet + REGS_EFLAGS]
popad
pop gs
pop fs
pop es
pop ds
ret
#include "../../include/arch/pc/pcbios.h"
#define EFLAGS_CF HEX(01)
#define EFLAGS_ZF HEX(40)
#define EFLAGS_SF HEX(80)
Int386:
/* Save all registers + segment registers */
push ds
push es
push fs
push gs
pushad
/* Get the interrupt vector and patch the opcode */
mov al, byte ptr ds:[BSS_IntVector]
mov byte ptr ds:[Int386_vector_opcode], al
/* Get current EFLAGS and mask CF, ZF and SF */
pushf
pop cx
and cx, not (EFLAGS_CF or EFLAGS_ZF or EFLAGS_SF)
/* Get flags CF, ZF and SF from the REGS structure */
mov ax, word ptr cs:[BSS_RegisterSet + REGS_EFLAGS]
and ax, (EFLAGS_CF or EFLAGS_ZF or EFLAGS_SF)
/* Combine flags and set them */
or ax, cx
push ax
popf
/* Setup the registers */
mov ax, word ptr cs:[BSS_RegisterSet + REGS_DS]
mov ds, ax
mov ax, word ptr cs:[BSS_RegisterSet + REGS_ES]
mov es, ax
mov ax, word ptr cs:[BSS_RegisterSet + REGS_FS]
mov fs, ax
mov ax, word ptr cs:[BSS_RegisterSet + REGS_GS]
mov gs, ax
mov eax, dword ptr cs:[BSS_RegisterSet + REGS_EAX]
mov ebx, dword ptr cs:[BSS_RegisterSet + REGS_EBX]
mov ecx, dword ptr cs:[BSS_RegisterSet + REGS_ECX]
mov edx, dword ptr cs:[BSS_RegisterSet + REGS_EDX]
mov esi, dword ptr cs:[BSS_RegisterSet + REGS_ESI]
mov edi, dword ptr cs:[BSS_RegisterSet + REGS_EDI]
// Don't setup ebp, we only use it as output!
/* Call the interrupt vector */
/*int Int386_vector*/
.byte HEX(0cd)
Int386_vector_opcode:
.byte 00
/* Save the registers */
mov dword ptr cs:[BSS_RegisterSet + REGS_EAX], eax
mov dword ptr cs:[BSS_RegisterSet + REGS_EBX], ebx
mov dword ptr cs:[BSS_RegisterSet + REGS_ECX], ecx
mov dword ptr cs:[BSS_RegisterSet + REGS_EDX], edx
mov dword ptr cs:[BSS_RegisterSet + REGS_ESI], esi
mov dword ptr cs:[BSS_RegisterSet + REGS_EDI], edi
mov dword ptr cs:[BSS_RegisterSet + REGS_EBP], ebp
mov ax, ds
mov word ptr cs:[BSS_RegisterSet + REGS_DS], ax
mov ax, es
mov word ptr cs:[BSS_RegisterSet + REGS_ES], ax
mov ax, fs
mov word ptr cs:[BSS_RegisterSet + REGS_FS], ax
mov ax, gs
mov word ptr cs:[BSS_RegisterSet + REGS_GS], ax
pushfd
pop dword ptr cs:[BSS_RegisterSet + REGS_EFLAGS]
popad
pop gs
pop fs
pop es
pop ds
ret

View file

@ -1,15 +1,15 @@
BootLinuxKernel:
// dl must be set to the boot drive
/* Load segment registers */
cli
mov bx, HEX(9000)
mov ds, bx
mov es, bx
mov fs, bx
mov gs, bx
mov ss, bx
mov sp, HEX(9000)
ljmp16 HEX(9020), HEX(0000)
BootLinuxKernel:
// dl must be set to the boot drive
/* Load segment registers */
cli
mov bx, HEX(9000)
mov ds, bx
mov es, bx
mov fs, bx
mov gs, bx
mov ss, bx
mov sp, HEX(9000)
ljmp16 HEX(9020), HEX(0000)

View file

@ -1,56 +1,56 @@
PnpBiosGetDeviceNodeCount:
mov ax, word ptr ds:[BSS_PnpBiosDataSegment]
push ax
push cs
mov ax, BSS_PnpNodeSize
push ax
push cs
mov ax, BSS_PnpNodeCount
push ax
push 0
call dword ptr ds:[BSS_PnpBiosEntryPoint]
add sp, 12
movzx ecx, ax
mov dword ptr ds:[BSS_PnpResult], ecx
ret
PnpBiosGetDeviceNode:
/* push bios segment */
mov ax, word ptr ds:[BSS_PnpBiosDataSegment]
push ax
/* push control flag */
push 1
/* push pointer to node buffer (segment/offset) */
mov ax, word ptr ds:[BSS_PnpBiosBufferSegment]
push ax
mov ax, word ptr ds:[BSS_PnpBiosBufferOffset]
push ax
/* push pointer to node number (segment/offset) */
push cs
mov ax, BSS_PnpNodeNumber
push ax
/* push function number */
push 1
/* call entry point */
call dword ptr ds:[BSS_PnpBiosEntryPoint]
add sp, 14
movzx ecx, ax
mov dword ptr ds:[BSS_PnpResult], ecx
ret
PnpBiosGetDeviceNodeCount:
mov ax, word ptr ds:[BSS_PnpBiosDataSegment]
push ax
push cs
mov ax, BSS_PnpNodeSize
push ax
push cs
mov ax, BSS_PnpNodeCount
push ax
push 0
call dword ptr ds:[BSS_PnpBiosEntryPoint]
add sp, 12
movzx ecx, ax
mov dword ptr ds:[BSS_PnpResult], ecx
ret
PnpBiosGetDeviceNode:
/* push bios segment */
mov ax, word ptr ds:[BSS_PnpBiosDataSegment]
push ax
/* push control flag */
push 1
/* push pointer to node buffer (segment/offset) */
mov ax, word ptr ds:[BSS_PnpBiosBufferSegment]
push ax
mov ax, word ptr ds:[BSS_PnpBiosBufferOffset]
push ax
/* push pointer to node number (segment/offset) */
push cs
mov ax, BSS_PnpNodeNumber
push ax
/* push function number */
push 1
/* call entry point */
call dword ptr ds:[BSS_PnpBiosEntryPoint]
add sp, 14
movzx ecx, ax
mov dword ptr ds:[BSS_PnpResult], ecx
ret

View file

@ -1,32 +1,32 @@
/*
* FreeLoader
* Copyright (C) 2011 Hervé Poussineau
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
PxeCallApi:
mov ax, word ptr ds:[BSS_PxeBufferSegment]
push ax
mov ax, word ptr ds:[BSS_PxeBufferOffset]
push ax
mov ax, word ptr ds:[BSS_PxeFunction]
push ax
call dword ptr ds:[BSS_PxeEntryPoint]
add esp, 6
mov word ptr ds:[BSS_PxeResult], ax
ret
/*
* FreeLoader
* Copyright (C) 2011 Hervé Poussineau
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
PxeCallApi:
mov ax, word ptr ds:[BSS_PxeBufferSegment]
push ax
mov ax, word ptr ds:[BSS_PxeBufferOffset]
push ax
mov ax, word ptr ds:[BSS_PxeFunction]
push ax
call dword ptr ds:[BSS_PxeEntryPoint]
add esp, 6
mov word ptr ds:[BSS_PxeResult], ax
ret