mirror of
https://github.com/reactos/reactos
synced 2025-10-06 16:32:42 +02:00
Compare commits
63 Commits
backups/rb
...
ReactOS-0.
Author | SHA1 | Date | |
---|---|---|---|
|
d72afbfce2 | ||
|
b6e9ff26a1 | ||
|
ad98278271 | ||
|
803f480c76 | ||
|
72e2950464 | ||
|
e63aeda6d8 | ||
|
7212484566 | ||
|
7323b45705 | ||
|
36a22c461d | ||
|
b5f41d1d76 | ||
|
c4c306835a | ||
|
8dabcc400b | ||
|
d861f06971 | ||
|
9de35ec976 | ||
|
afb01dca9a | ||
|
1af0e84505 | ||
|
11a1a6f5f8 | ||
|
71db5a6473 | ||
|
963957a699 | ||
|
109cad87d9 | ||
|
0345cf90c7 | ||
|
e47eef8914 | ||
|
e0ab101925 | ||
|
0d42b181bb | ||
|
c194b7fa9b | ||
|
002748256c | ||
|
7a9a913a59 | ||
|
76049766c7 | ||
|
4e765f3e85 | ||
|
9692e2a77f | ||
|
fed6bde1dc | ||
|
016a2bc3c9 | ||
|
102134ce8e | ||
|
0b12296df5 | ||
|
3ade955abd | ||
|
9e97899046 | ||
|
068c8ac211 | ||
|
848a01a34d | ||
|
82f3314cb8 | ||
|
781d8ea771 | ||
|
a5204bfefc | ||
|
a22281bd43 | ||
|
542d8f20e8 | ||
|
862a718c61 | ||
|
300f1e45c6 | ||
|
be05e632d1 | ||
|
6983c0303f | ||
|
cf6e870af4 | ||
|
f02f38857a | ||
|
89f0c0ef87 | ||
|
4f08685138 | ||
|
c4e6fde5ff | ||
|
70fac7864a | ||
|
d0e37cc6cb | ||
|
81083994a6 | ||
|
2e4614673d | ||
|
173b4f4fca | ||
|
f9d1d614d7 | ||
|
dd284cb19e | ||
|
3307299225 | ||
|
017023a311 | ||
|
44a77cafb1 | ||
|
779acf8594 |
46
cis/ReactOS.ApiStatus/Default.build
Normal file
46
cis/ReactOS.ApiStatus/Default.build
Normal file
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
Copyright (C) 2005 Casper S. Hornstrup
|
||||
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
-->
|
||||
<project name="ReactOS.ApiStatus" default="publish">
|
||||
|
||||
<property name="reactos.dir" value="reactos" />
|
||||
<property name="apistatus.xsl" value="rapistatus.xsl" />
|
||||
<property name="apistatus.xml" value="rapistatus.xml" />
|
||||
<property name="apistatus.html" value="index2.html" />
|
||||
<include buildfile="config.include" />
|
||||
|
||||
<target name="publish">
|
||||
<delete dir="${reactos.dir}" if="${directory::exists(reactos.dir)}" />
|
||||
<exec program="svn" commandline="export -r HEAD ${source.url} ${reactos.dir}" />
|
||||
<exec program="rgenstat" commandline="reactos\apistatus.lst ${apistatus.xml}" />
|
||||
<style style="${apistatus.xsl}" destdir="${reactos.dir}" in="${apistatus.xml}" out="${apistatus.html}" />
|
||||
<copy todir="${publish.dir}" overwrite="true">
|
||||
<fileset basedir=".">
|
||||
<include name="${apistatus.xml}" />
|
||||
<include name="${apistatus.html}" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<delete>
|
||||
<fileset basedir=".">
|
||||
<include name="${apistatus.xml}" />
|
||||
<include name="${apistatus.html}" />
|
||||
</fileset>
|
||||
</delete>
|
||||
<delete dir="${reactos.dir}" if="${directory::exists(reactos.dir)}" />
|
||||
</target>
|
||||
</project>
|
22
cis/ReactOS.ApiStatus/config.template.include
Normal file
22
cis/ReactOS.ApiStatus/config.template.include
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2005 Casper S. Hornstrup
|
||||
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
-->
|
||||
<project>
|
||||
<property name="source.url" value="svn://svn.reactos.com/trunk/reactos" />
|
||||
<property name="publish.dir" value="C:\api" />
|
||||
</project>
|
@@ -47,8 +47,8 @@
|
||||
<TD> Implemented </TD>
|
||||
<TD> <IMG src="sc.gif"/> </TD>
|
||||
<TD> Complete </TD>
|
||||
</TR>
|
||||
<TR>
|
||||
</TR>
|
||||
<TD> <IMG src="f.gif"/> </TD>
|
||||
<TD> Function </TD>
|
||||
<TD> <IMG src="u.gif"/> </TD>
|
10
cis/ReactOS.CustomRevisionAction/App.config
Normal file
10
cis/ReactOS.CustomRevisionAction/App.config
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<appSettings>
|
||||
<add key="publishPath" value="c:\iso" /> <!-- c:\iso or ftp://ftp.server.com/iso -->
|
||||
<add key="smtpServer" value="localhost" />
|
||||
<add key="errorEmail" value="mailbox@somewhere-on-the-net" />
|
||||
<add key="makeParameters" value="" />
|
||||
<add key="fastDisk" value="" />
|
||||
</appSettings>
|
||||
</configuration>
|
14
cis/ReactOS.CustomRevisionAction/AssemblyInfo.cs
Normal file
14
cis/ReactOS.CustomRevisionAction/AssemblyInfo.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
[assembly: AssemblyTitle("ReactOS Sin Custom Revision Action")]
|
||||
[assembly: AssemblyDescription("ReactOS Sin Custom Revision Action")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("ReactOS Project")]
|
||||
[assembly: AssemblyProduct("React Operating System")]
|
||||
[assembly: AssemblyCopyright("Copyright 2005 ReactOS Project")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyDelaySign(false)]
|
||||
[assembly: AssemblyKeyFile("")]
|
20
cis/ReactOS.CustomRevisionAction/Default.build
Normal file
20
cis/ReactOS.CustomRevisionAction/Default.build
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0"?>
|
||||
<project name="ReactOS.CustomRevisionAction" default="build">
|
||||
|
||||
<property name="output.dir" value="bin" />
|
||||
|
||||
<target name="build" description="Build component">
|
||||
<mkdir dir="${output.dir}" />
|
||||
<csc target="exe"
|
||||
output="${output.dir}\ReactOS.CustomRevisionAction.exe"
|
||||
optimize="true"
|
||||
debug="true"
|
||||
doc="${output.dir}\ReactOS.CustomRevisionAction.xml"
|
||||
warninglevel="0">
|
||||
<sources>
|
||||
<include name="*.cs" />
|
||||
</sources>
|
||||
</csc>
|
||||
</target>
|
||||
|
||||
</project>
|
1054
cis/ReactOS.CustomRevisionAction/FtpClient.cs
Normal file
1054
cis/ReactOS.CustomRevisionAction/FtpClient.cs
Normal file
File diff suppressed because it is too large
Load Diff
340
cis/ReactOS.CustomRevisionAction/Main.cs
Normal file
340
cis/ReactOS.CustomRevisionAction/Main.cs
Normal file
@@ -0,0 +1,340 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Diagnostics;
|
||||
using System.Configuration;
|
||||
using System.Web.Mail;
|
||||
|
||||
namespace ReactOS.CustomRevisionAction
|
||||
{
|
||||
public class MainClass
|
||||
{
|
||||
/// <summary>
|
||||
/// Path to store published binaries at.
|
||||
/// </summary>
|
||||
private static string publishPath;
|
||||
|
||||
/// <summary>
|
||||
/// Whether or not to publish ISOs to a remote destination via FTP.
|
||||
/// </summary>
|
||||
private static bool PublishToRemoteFtpLocation
|
||||
{
|
||||
get
|
||||
{
|
||||
return publishPath.StartsWith("ftp://");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Run the application.
|
||||
/// </summary>
|
||||
/// <param name="script">Script to run.</param>
|
||||
/// <param name="args">Arguments to pass to script.</param>
|
||||
/// <param name="workingDirectory">Working directory.</param>
|
||||
/// <param name="standardOutput">Receives standard output.</param>
|
||||
/// <param name="standardError">Receives standard error.</param>
|
||||
/// <returns>
|
||||
/// Exit code.
|
||||
/// </returns>
|
||||
private static int RunScript(string script,
|
||||
string args,
|
||||
string workingDirectory,
|
||||
out string standardOutput,
|
||||
out string standardError)
|
||||
{
|
||||
ProcessStartInfo scriptProcessStartInfo = new ProcessStartInfo(script,
|
||||
args);
|
||||
scriptProcessStartInfo.CreateNoWindow = true;
|
||||
/*
|
||||
* All standard streams must be redirected.
|
||||
* Otherwise DuplicateHandle() will fail.
|
||||
*/
|
||||
scriptProcessStartInfo.RedirectStandardInput = true;
|
||||
scriptProcessStartInfo.RedirectStandardError = true;
|
||||
scriptProcessStartInfo.RedirectStandardOutput = true;
|
||||
scriptProcessStartInfo.UseShellExecute = false;
|
||||
scriptProcessStartInfo.WorkingDirectory = workingDirectory;
|
||||
RedirectableProcess redirectableProcess = new RedirectableProcess(scriptProcessStartInfo);
|
||||
standardOutput = redirectableProcess.ProcessOutput;
|
||||
standardError = redirectableProcess.ProcessError;
|
||||
return redirectableProcess.ExitCode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve value of configuration from configuration file.
|
||||
/// </summary>
|
||||
/// <param name="name">Name of configuration option.</param>
|
||||
/// <param name="defaultValue">
|
||||
/// Default value to be returned if the option does not exist.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// Value of configuration option or null if the option does not
|
||||
/// exist and no default value is provided.
|
||||
/// </returns>
|
||||
private static string GetConfigurationOption(string name,
|
||||
string defaultValue)
|
||||
{
|
||||
if (ConfigurationSettings.AppSettings[name] != null)
|
||||
return ConfigurationSettings.AppSettings[name];
|
||||
else
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Send an email.
|
||||
/// </summary>
|
||||
/// <param name="subject">Subject of the email.</param>
|
||||
/// <param name="body">Content of the email.</param>
|
||||
private static void SendErrorMail(string subject, string body)
|
||||
{
|
||||
try
|
||||
{
|
||||
string smtpServer = GetConfigurationOption("smtpServer", "localhost");
|
||||
string toEmail = GetConfigurationOption("errorEmail", null);
|
||||
if (toEmail == null)
|
||||
return;
|
||||
string fromEmail = GetConfigurationOption("fromEmail", null);
|
||||
if (fromEmail == null)
|
||||
fromEmail = toEmail;
|
||||
MailMessage mm = new MailMessage();
|
||||
mm.Priority = MailPriority.Normal;
|
||||
mm.From = toEmail;
|
||||
mm.To = toEmail;
|
||||
mm.Subject = subject;
|
||||
mm.Body += body;
|
||||
mm.Body += "<br>";
|
||||
mm.BodyFormat = MailFormat.Html;
|
||||
SmtpMail.SmtpServer = smtpServer;
|
||||
SmtpMail.Send(mm);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.Error.WriteLine(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fail with an error message.
|
||||
/// </summary>
|
||||
/// <param name="revision">Repository revision.</param>
|
||||
/// <param name="text">Error message.</param>
|
||||
private static void Fail(int revision,
|
||||
string text)
|
||||
{
|
||||
Console.WriteLine(text);
|
||||
Console.Error.WriteLine(text);
|
||||
SendErrorMail(String.Format("[{0}] ReactOS Publish Error", revision), text);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fail with an error message.
|
||||
/// </summary>
|
||||
/// <param name="text">Error message.</param>
|
||||
private static void Fail(string text)
|
||||
{
|
||||
Console.WriteLine(text);
|
||||
Console.Error.WriteLine(text);
|
||||
SendErrorMail("ReactOS Publish Error", text);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generate filename of distribution.
|
||||
/// </summary>
|
||||
/// <param name="branch">Branch.</param>
|
||||
/// <param name="revision">Revision.</param>
|
||||
private static string GetDistributionFilename(string branch,
|
||||
int revision)
|
||||
{
|
||||
return String.Format("ReactOS-{0}-r{1}.iso",
|
||||
branch,
|
||||
revision);
|
||||
}
|
||||
|
||||
private static void SplitRemotePublishPath(string publishPath,
|
||||
out string server,
|
||||
out string directory)
|
||||
{
|
||||
string searchString = "://";
|
||||
int index = publishPath.IndexOf(searchString);
|
||||
if (index == -1)
|
||||
throw new InvalidOperationException();
|
||||
int endOfProtocolIndex = index + searchString.Length;
|
||||
string withoutProtocol = publishPath.Remove(0, endOfProtocolIndex);
|
||||
index = withoutProtocol.IndexOf("/");
|
||||
if (index == -1)
|
||||
{
|
||||
server = withoutProtocol;
|
||||
directory = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
server = withoutProtocol.Substring(0, index);
|
||||
directory = withoutProtocol.Remove(0, index + 1);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Copy ISO to the (remote) destination.
|
||||
/// </summary>
|
||||
/// <param name="sourceFilename">Name of source ISO file to copy.</param>
|
||||
/// <param name="branch">Branch.</param>
|
||||
/// <param name="revision">Revision.</param>
|
||||
/// <remarks>
|
||||
/// Structure is ftp://ftp.server.com/whereever/<branch>/ReactOS-<branch>-r<revision>.iso.
|
||||
/// </remarks>
|
||||
private static void CopyISOToRemoteFtpDestination(string sourceFilename,
|
||||
string branch,
|
||||
int revision)
|
||||
{
|
||||
string distributionFilename = GetDistributionFilename(branch,
|
||||
revision);
|
||||
string destinationFilename = Path.Combine(Path.GetDirectoryName(sourceFilename),
|
||||
distributionFilename);
|
||||
File.Move(sourceFilename, destinationFilename);
|
||||
string server;
|
||||
string directory;
|
||||
SplitRemotePublishPath(publishPath, out server, out directory);
|
||||
FtpClient ftpClient = new FtpClient(server, "anonymous", "sin@svn.reactos.com");
|
||||
ftpClient.Login();
|
||||
if (directory != "")
|
||||
ftpClient.ChangeDir(directory);
|
||||
/* Create destination directory if it does not already exist */
|
||||
if (!ftpClient.DirectoryExists(branch))
|
||||
ftpClient.MakeDir(branch);
|
||||
ftpClient.ChangeDir(branch);
|
||||
ftpClient.Upload(destinationFilename);
|
||||
ftpClient.Close();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Copy ISO to the (local) destination.
|
||||
/// </summary>
|
||||
/// <param name="sourceFilename">Name of source ISO file to copy.</param>
|
||||
/// <param name="branch">Branch.</param>
|
||||
/// <param name="revision">Revision.</param>
|
||||
/// <remarks>
|
||||
/// Structure is <branch>\ReactOS-<branch>-r<revision>.iso.
|
||||
/// </remarks>
|
||||
private static void CopyISOToLocalDestination(string sourceFilename,
|
||||
string branch,
|
||||
int revision)
|
||||
{
|
||||
string distributionFilename = GetDistributionFilename(branch,
|
||||
revision);
|
||||
string destinationDirectory = Path.Combine(publishPath,
|
||||
branch);
|
||||
string destinationFilename = Path.Combine(destinationDirectory,
|
||||
distributionFilename);
|
||||
if (!Directory.Exists(destinationDirectory))
|
||||
Directory.CreateDirectory(destinationDirectory);
|
||||
File.Copy(sourceFilename,
|
||||
destinationFilename);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Copy ISO to the destination.
|
||||
/// </summary>
|
||||
/// <param name="sourceFilename">Name of source ISO file to copy.</param>
|
||||
/// <param name="branch">Branch.</param>
|
||||
/// <param name="revision">Revision.</param>
|
||||
/// <remarks>
|
||||
/// Structure is <branch>\ReactOS-<branch>-r<revision>.iso.
|
||||
/// </remarks>
|
||||
private static void CopyISOToDestination(string sourceFilename,
|
||||
string branch,
|
||||
int revision)
|
||||
{
|
||||
if (PublishToRemoteFtpLocation)
|
||||
CopyISOToRemoteFtpDestination(sourceFilename, branch, revision);
|
||||
else
|
||||
CopyISOToLocalDestination(sourceFilename, branch, revision);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Publish a revision of ReactOS.
|
||||
/// </summary>
|
||||
/// <param name="text">Error message.</param>
|
||||
private static int Publish(string branch,
|
||||
int revision,
|
||||
string workingDirectory)
|
||||
{
|
||||
string make = "mingw32-make";
|
||||
string makeParameters = GetConfigurationOption("makeParameters", "");
|
||||
string reactosDirectory = Path.Combine(workingDirectory,
|
||||
"reactos");
|
||||
Console.WriteLine(String.Format("ReactOS directory is {0}",
|
||||
reactosDirectory));
|
||||
string standardOutput;
|
||||
string standardError;
|
||||
int exitCode = RunScript(make,
|
||||
makeParameters + " bootcd",
|
||||
reactosDirectory,
|
||||
out standardOutput,
|
||||
out standardError);
|
||||
if (exitCode != 0)
|
||||
{
|
||||
Fail(revision,
|
||||
String.Format("make bootcd failed: (error: {0}) {1}",
|
||||
standardError,
|
||||
standardOutput));
|
||||
return exitCode;
|
||||
}
|
||||
|
||||
string sourceFilename = Path.Combine(reactosDirectory,
|
||||
"ReactOS.iso");
|
||||
if (File.Exists(sourceFilename))
|
||||
CopyISOToDestination(sourceFilename,
|
||||
branch,
|
||||
revision);
|
||||
else
|
||||
{
|
||||
Fail(revision,
|
||||
"make bootcd produced no ReactOS.iso");
|
||||
return exitCode;
|
||||
}
|
||||
|
||||
return exitCode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Program entry point.
|
||||
/// </summary>
|
||||
/// <param name="args">Arguments from command line.</param>
|
||||
/// <remarks>
|
||||
/// If exit code is 0, then the commit was processed successfully.
|
||||
/// If exit code is 1, then the commit was not processed successfully.
|
||||
/// </remarks>
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
try
|
||||
{
|
||||
System.Environment.ExitCode = 1;
|
||||
|
||||
publishPath = ConfigurationSettings.AppSettings["publishPath"];
|
||||
if (publishPath == null)
|
||||
{
|
||||
Fail("PublishPath option not set.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (args.Length < 3)
|
||||
{
|
||||
Fail("Usage: ReactOS.CustomRevisionAction action branch revision");
|
||||
return;
|
||||
}
|
||||
|
||||
string action = args[0]; /* bootcd */
|
||||
string branch = args[1];
|
||||
int revision = Int32.Parse(args[2]);
|
||||
|
||||
System.Environment.ExitCode = Publish(branch,
|
||||
revision,
|
||||
System.Environment.CurrentDirectory);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Fail(String.Format("Exception: {0}", ex));
|
||||
System.Environment.ExitCode = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
145
cis/ReactOS.CustomRevisionAction/RedirectableProcess.cs
Normal file
145
cis/ReactOS.CustomRevisionAction/RedirectableProcess.cs
Normal file
@@ -0,0 +1,145 @@
|
||||
/*
|
||||
* When using the ProcessStartInfo.RedirectStandardXxx properties there is a chance of
|
||||
* the parent and child process blocking due to a race condition. This class handles the
|
||||
* problem.
|
||||
* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdiagnosticsprocessstartinfoclassredirectstandardoutputtopic.asp
|
||||
*/
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace ReactOS.CustomRevisionAction
|
||||
{
|
||||
/// <summary>
|
||||
/// Process that redirects standard output and standard error streams.
|
||||
/// </summary>
|
||||
public class RedirectableProcess
|
||||
{
|
||||
/// <summary>
|
||||
/// Process.
|
||||
/// </summary>
|
||||
private Process process;
|
||||
|
||||
/// <summary>
|
||||
/// Redirected standard error stream.
|
||||
/// </summary>
|
||||
private string processError;
|
||||
|
||||
/// <summary>
|
||||
/// Redirected standard output stream.
|
||||
/// </summary>
|
||||
private string processOutput;
|
||||
|
||||
/// <summary>
|
||||
/// Exit code.
|
||||
/// </summary>
|
||||
private int exitCode;
|
||||
|
||||
/// <summary>
|
||||
/// Redirected standard error stream.
|
||||
/// </summary>
|
||||
public string ProcessError
|
||||
{
|
||||
get
|
||||
{
|
||||
return processError;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Redirected standard output stream.
|
||||
/// </summary>
|
||||
public string ProcessOutput
|
||||
{
|
||||
get
|
||||
{
|
||||
return processOutput;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Exit code.
|
||||
/// </summary>
|
||||
public int ExitCode
|
||||
{
|
||||
get
|
||||
{
|
||||
return exitCode;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Run an excutable and redirect standard error and/or standard output safely.
|
||||
/// </summary>
|
||||
public RedirectableProcess(ProcessStartInfo processStartInfo)
|
||||
{
|
||||
Run(processStartInfo, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Run an excutable and redirect standard error and/or standard output safely.
|
||||
/// </summary>
|
||||
public RedirectableProcess(ProcessStartInfo processStartInfo, string input)
|
||||
{
|
||||
Run(processStartInfo, input);
|
||||
}
|
||||
|
||||
private void Run(ProcessStartInfo processStartInfo, string input)
|
||||
{
|
||||
process = new Process();
|
||||
process.StartInfo = processStartInfo;
|
||||
process.Start();
|
||||
if (processStartInfo.RedirectStandardInput && input != null)
|
||||
{
|
||||
process.StandardInput.AutoFlush = true;
|
||||
process.StandardInput.WriteLine(input);
|
||||
}
|
||||
Thread readStandardError = null;
|
||||
if (processStartInfo.RedirectStandardError)
|
||||
{
|
||||
readStandardError = new Thread(new ThreadStart(ReadStandardError));
|
||||
readStandardError.Start();
|
||||
}
|
||||
Thread readStandardOutput = null;
|
||||
if (processStartInfo.RedirectStandardOutput)
|
||||
{
|
||||
readStandardOutput = new Thread(new ThreadStart(ReadStandardOutput));
|
||||
readStandardOutput.Start();
|
||||
}
|
||||
if (processStartInfo.RedirectStandardError)
|
||||
{
|
||||
readStandardError.Join();
|
||||
}
|
||||
if (processStartInfo.RedirectStandardOutput)
|
||||
{
|
||||
readStandardOutput.Join();
|
||||
}
|
||||
process.WaitForExit();
|
||||
exitCode = process.ExitCode;
|
||||
process = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read standard error thread entry-point.
|
||||
/// </summary>
|
||||
private void ReadStandardError()
|
||||
{
|
||||
if (process != null)
|
||||
{
|
||||
processError = process.StandardError.ReadToEnd();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read standard output thread entry-point.
|
||||
/// </summary>
|
||||
private void ReadStandardOutput()
|
||||
{
|
||||
if (process != null)
|
||||
{
|
||||
processOutput = process.StandardOutput.ReadToEnd();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
8
cis/ReactOS.RevisionISO/config.template.php
Normal file
8
cis/ReactOS.RevisionISO/config.template.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
/* Rename to config.php */
|
||||
|
||||
define(ISO_BASE_URL, "http://www.server.com/iso/");
|
||||
define(ISO_PATH, "C:\\iso\\");
|
||||
|
||||
?>
|
230
cis/ReactOS.RevisionISO/index.php
Normal file
230
cis/ReactOS.RevisionISO/index.php
Normal file
@@ -0,0 +1,230 @@
|
||||
<?php
|
||||
|
||||
include ('config.php');
|
||||
|
||||
function dm_usort_cmp ($a, $b) {
|
||||
if ($a == $b) return 0;
|
||||
return ($a > $b) ? -1 : 1;
|
||||
}
|
||||
|
||||
function dm_usort_cmp_desc ($a, $b) {
|
||||
if ($a == $b) return 0;
|
||||
return ($a > $b) ? 1 : -1;
|
||||
}
|
||||
|
||||
function printHeader()
|
||||
{
|
||||
?>
|
||||
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>ReactOS Revison ISOs</title>
|
||||
<meta name="generator" content="Editpad">
|
||||
<meta name="keywords" content="OS, ReactOS, operating system">
|
||||
<meta name="author" content="ReactOS Project (ros-dev@reactos.com)">
|
||||
<style>
|
||||
.box
|
||||
{
|
||||
padding: 0px;
|
||||
background-color: #88aadd;
|
||||
border-left: 1px solid #f0f0f0;
|
||||
border-right: 1px solid #000000;
|
||||
border-top: 1px solid #f0f0f0;
|
||||
border-bottom: 1px solid #000000;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body bgcolor="#88aadd">
|
||||
<form method="post" action="">
|
||||
<?php
|
||||
}
|
||||
|
||||
function printMenu($revision)
|
||||
{
|
||||
?>
|
||||
<table border="0" class="box" cellpadding="5">
|
||||
<tr>
|
||||
<td height="2px">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td>
|
||||
<b>Branch:</b>
|
||||
</td>
|
||||
<td>
|
||||
<select name="branch" tabindex="1">
|
||||
<?php
|
||||
|
||||
$d = dir(ISO_PATH);
|
||||
$i = 0;
|
||||
$dirlist = array();
|
||||
while (false !== ($entry = $d->read())) {
|
||||
if ((strcasecmp($entry, ".") != 0) && (strcasecmp($entry, "..") != 0) && is_dir(ISO_PATH . "\\" . $entry) == "dir") {
|
||||
$dirlist[$i++] = $entry;
|
||||
}
|
||||
}
|
||||
$d->close();
|
||||
|
||||
if (is_array($dirlist)) {
|
||||
usort($dirlist, "dm_usort_cmp");
|
||||
reset($dirlist);
|
||||
while (list($key, $val) = each($dirlist)) {
|
||||
$branch = $val;
|
||||
if ($branch == $_POST["branch"] || (!isset($_POST["branch"]) && $branch == "trunk"))
|
||||
$selected = " selected";
|
||||
else
|
||||
$selected = "";
|
||||
echo "<option$selected>$branch</option>";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<b>Revision:</b>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
echo "<input type=\"text\" name=\"revision\" size=\"10\" maxlength=\"10\" tabindex=\"2\" value=\"" . $revision . "\"></input>";
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<input type="submit" name="getiso" value="Download" tabindex="3" style="border: 1px solid #000000"></input>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="7">
|
||||
<hr size="2" width="100%" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<input type="submit" name="getnextiso" value="Next ISO" tabindex="4" style="border: 1px solid #000000"></input>
|
||||
</td>
|
||||
<td colspan="3" align="right">
|
||||
<input type="submit" name="getlatestiso" value="Latest ISO" tabindex="5" style="border: 1px solid #000000"></input>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="2px">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
|
||||
function printFooter()
|
||||
{
|
||||
?>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
var revision = document.getElementById('revision');
|
||||
if (revision) revision.focus();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
}
|
||||
|
||||
function locateRevisionISO($branch, $revision, $latest)
|
||||
{
|
||||
$revision = intval($revision);
|
||||
$path = ISO_PATH . "\\" . $branch;
|
||||
$d = dir($path);
|
||||
$i = 0;
|
||||
$filelist = array();
|
||||
while (false !== ($entry = $d->read())) {
|
||||
if (is_dir($path . "\\" . $entry) != "dir")
|
||||
$filelist[$i++] = $entry;
|
||||
}
|
||||
$d->close();
|
||||
|
||||
if (is_array($filelist)) {
|
||||
$sortFunction = $latest ? "dm_usort_cmp" : "dm_usort_cmp_desc";
|
||||
usort($filelist, $sortFunction);
|
||||
reset($filelist);
|
||||
while (list($key, $filename) = each($filelist)) {
|
||||
if (ereg('ReactOS-' . $branch . '-r([0-9]*).iso', $filename, $regs))
|
||||
{
|
||||
$thisRevision = intval($regs[1]);
|
||||
if (($latest) && ($thisRevision < $revision))
|
||||
return $regs[1];
|
||||
else if ($thisRevision > $revision)
|
||||
return $regs[1];
|
||||
$lastRevision = $thisRevision;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
function getNextRevisionISO($branch, $revision)
|
||||
{
|
||||
return locateRevisionISO($branch, $revision, false);
|
||||
}
|
||||
|
||||
function getLatestRevisionISO($branch)
|
||||
{
|
||||
return locateRevisionISO($branch, 999999, true);
|
||||
}
|
||||
|
||||
function main()
|
||||
{
|
||||
$branch = $_POST["branch"];
|
||||
$revision = $_POST["revision"];
|
||||
|
||||
$filename = "ReactOS-" . $branch . "-r" . $revision . ".iso";
|
||||
if (file_exists(ISO_PATH . $branch . "\\" . $filename))
|
||||
{
|
||||
$location = ISO_BASE_URL . $branch . "/" . $filename;
|
||||
header("Location: $location");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
printHeader();
|
||||
printMenu($_POST["revision"]);
|
||||
echo "<br><b>No ISO exist for branch '" . $branch . "' and revision " . $revision . ".</b><br><br>";
|
||||
printFooter();
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($_POST["getiso"]) && !empty($_POST["branch"]) && !empty($_POST["revision"]) && is_numeric($_POST["revision"]))
|
||||
main();
|
||||
else if (!empty($_POST["getnextiso"]) && !empty($_POST["branch"]) && !empty($_POST["revision"]) && is_numeric($_POST["revision"]))
|
||||
{
|
||||
printHeader();
|
||||
printMenu(getNextRevisionISO($_POST["branch"], $_POST["revision"]));
|
||||
printFooter();
|
||||
}
|
||||
else if (!empty($_POST["getlatestiso"]) && !empty($_POST["branch"]))
|
||||
{
|
||||
printHeader();
|
||||
printMenu(getLatestRevisionISO($_POST["branch"]));
|
||||
printFooter();
|
||||
}
|
||||
else
|
||||
{
|
||||
printHeader();
|
||||
printMenu($_POST["revision"]);
|
||||
printFooter();
|
||||
}
|
||||
|
||||
?>
|
9
cis/ReactOS.Verify/App.config
Normal file
9
cis/ReactOS.Verify/App.config
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<appSettings>
|
||||
<add key="smtpServer" value="localhost" />
|
||||
<add key="errorEmail" value="mailbox@somewhere-on-the-net" />
|
||||
<add key="makeParameters" value="" />
|
||||
<add key="fastDisk" value="" />
|
||||
</appSettings>
|
||||
</configuration>
|
14
cis/ReactOS.Verify/AssemblyInfo.cs
Normal file
14
cis/ReactOS.Verify/AssemblyInfo.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
[assembly: AssemblyTitle("ReactOS Sin Verifier")]
|
||||
[assembly: AssemblyDescription("ReactOS Sin Verifier")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("ReactOS Project")]
|
||||
[assembly: AssemblyProduct("React Operating System")]
|
||||
[assembly: AssemblyCopyright("Copyright 2005 ReactOS Project")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyDelaySign(false)]
|
||||
[assembly: AssemblyKeyFile("")]
|
20
cis/ReactOS.Verify/Default.build
Normal file
20
cis/ReactOS.Verify/Default.build
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0"?>
|
||||
<project name="ReactOS.Verify" default="build">
|
||||
|
||||
<property name="output.dir" value="bin" />
|
||||
|
||||
<target name="build" description="Build component">
|
||||
<mkdir dir="${output.dir}" />
|
||||
<csc target="exe"
|
||||
output="${output.dir}\ReactOS.Verify.exe"
|
||||
optimize="true"
|
||||
debug="true"
|
||||
doc="${output.dir}\ReactOS.Verify.xml"
|
||||
warninglevel="0">
|
||||
<sources>
|
||||
<include name="*.cs" />
|
||||
</sources>
|
||||
</csc>
|
||||
</target>
|
||||
|
||||
</project>
|
279
cis/ReactOS.Verify/Main.cs
Normal file
279
cis/ReactOS.Verify/Main.cs
Normal file
@@ -0,0 +1,279 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Diagnostics;
|
||||
using System.Configuration;
|
||||
using System.Web.Mail;
|
||||
using System.Collections;
|
||||
using System.Collections.Specialized;
|
||||
|
||||
namespace ReactOS.Verify
|
||||
{
|
||||
public class MainClass
|
||||
{
|
||||
/// <summary>
|
||||
/// Run the application.
|
||||
/// </summary>
|
||||
/// <param name="script">Script to run.</param>
|
||||
/// <param name="args">Arguments to pass to script.</param>
|
||||
/// <param name="workingDirectory">Working directory.</param>
|
||||
/// <param name="standardOutput">Receives standard output.</param>
|
||||
/// <param name="standardError">Receives standard error.</param>
|
||||
/// <returns>
|
||||
/// Exit code.
|
||||
/// </returns>
|
||||
private static int RunScript(string script,
|
||||
string args,
|
||||
string workingDirectory,
|
||||
StringDictionary environmentVarables,
|
||||
out string standardOutput,
|
||||
out string standardError)
|
||||
{
|
||||
ProcessStartInfo scriptProcessStartInfo = new ProcessStartInfo(script,
|
||||
args);
|
||||
scriptProcessStartInfo.CreateNoWindow = true;
|
||||
/*
|
||||
* All standard streams must be redirected.
|
||||
* Otherwise DuplicateHandle() will fail.
|
||||
*/
|
||||
scriptProcessStartInfo.RedirectStandardInput = true;
|
||||
scriptProcessStartInfo.RedirectStandardError = true;
|
||||
scriptProcessStartInfo.RedirectStandardOutput = true;
|
||||
scriptProcessStartInfo.UseShellExecute = false;
|
||||
scriptProcessStartInfo.WorkingDirectory = workingDirectory;
|
||||
if (environmentVarables != null)
|
||||
{
|
||||
foreach (DictionaryEntry de in environmentVarables)
|
||||
scriptProcessStartInfo.EnvironmentVariables.Add(de.Key as string, de.Value as string);
|
||||
}
|
||||
RedirectableProcess redirectableProcess = new RedirectableProcess(scriptProcessStartInfo);
|
||||
standardOutput = redirectableProcess.ProcessOutput;
|
||||
standardError = redirectableProcess.ProcessError;
|
||||
return redirectableProcess.ExitCode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve value of configuration from configuration file.
|
||||
/// </summary>
|
||||
/// <param name="name">Name of configuration option.</param>
|
||||
/// <param name="defaultValue">
|
||||
/// Default value to be returned if the option does not exist.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// Value of configuration option or null if the option does not
|
||||
/// exist and no default value is provided.
|
||||
/// </returns>
|
||||
private static string GetConfigurationOption(string name,
|
||||
string defaultValue)
|
||||
{
|
||||
if (ConfigurationSettings.AppSettings[name] != null)
|
||||
{
|
||||
string s = ConfigurationSettings.AppSettings[name].Trim();
|
||||
return s.Equals(String.Empty) ? defaultValue : s;
|
||||
}
|
||||
else
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Send an email.
|
||||
/// </summary>
|
||||
/// <param name="subject">Subject of the email.</param>
|
||||
/// <param name="body">Content of the email.</param>
|
||||
private static void SendErrorMail(string subject, string body)
|
||||
{
|
||||
try
|
||||
{
|
||||
string smtpServer = GetConfigurationOption("smtpServer", "localhost");
|
||||
string email = GetConfigurationOption("errorEmail", null);
|
||||
if (email == null)
|
||||
return;
|
||||
MailMessage mm = new MailMessage();
|
||||
mm.Priority = MailPriority.Normal;
|
||||
mm.From = email;
|
||||
mm.To = email;
|
||||
mm.Subject = subject;
|
||||
mm.Body += body;
|
||||
mm.Body += "<br>";
|
||||
mm.BodyFormat = MailFormat.Html;
|
||||
SmtpMail.SmtpServer = smtpServer;
|
||||
SmtpMail.Send(mm);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.Error.WriteLine(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fail with an error message.
|
||||
/// </summary>
|
||||
/// <param name="text">Error message.</param>
|
||||
private static void Fail(string text)
|
||||
{
|
||||
Console.WriteLine(text);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Paths to fast disk for temporary files.
|
||||
/// </summary>
|
||||
private static string TemporaryFastDisk
|
||||
{
|
||||
get
|
||||
{
|
||||
string temporaryFastDisk = GetConfigurationOption("temporaryFastDisk", null);
|
||||
if (temporaryFastDisk == null || temporaryFastDisk.Trim().Equals(String.Empty))
|
||||
return null;
|
||||
return temporaryFastDisk.Trim();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Paths to fast disk for intermediate files.
|
||||
/// </summary>
|
||||
private static string IntermediateFastDisk
|
||||
{
|
||||
get
|
||||
{
|
||||
string intermediateFastDisk = GetConfigurationOption("intermediateFastDisk", null);
|
||||
if (intermediateFastDisk == null || intermediateFastDisk.Trim().Equals(String.Empty))
|
||||
return null;
|
||||
return intermediateFastDisk.Trim();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Paths to fast disk for output files.
|
||||
/// </summary>
|
||||
private static string OutputFastDisk
|
||||
{
|
||||
get
|
||||
{
|
||||
string outputFastDisk = GetConfigurationOption("outputFastDisk", null);
|
||||
if (outputFastDisk == null || outputFastDisk.Trim().Equals(String.Empty))
|
||||
return null;
|
||||
return outputFastDisk.Trim();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Return collection of environment variables.
|
||||
/// </summary>
|
||||
/// <returns>Collection of environment variables or null if there is none.</returns>
|
||||
private static StringDictionary GetEnvironmentVarables()
|
||||
{
|
||||
StringDictionary environmentVarables = new StringDictionary();
|
||||
if (TemporaryFastDisk != null)
|
||||
environmentVarables.Add("ROS_TEMPORARY", TemporaryFastDisk);
|
||||
if (IntermediateFastDisk != null)
|
||||
environmentVarables.Add("ROS_INTERMEDIATE", IntermediateFastDisk);
|
||||
if (OutputFastDisk != null)
|
||||
environmentVarables.Add("ROS_OUTPUT", OutputFastDisk);
|
||||
return environmentVarables;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Run make.
|
||||
/// </summary>
|
||||
/// <param name="arguments">Arguments.</param>
|
||||
/// <param name="standardOutput">Receives standard output.</param>
|
||||
/// <param name="standardError">Receives standard error.</param>
|
||||
/// <returns>Make exit code.</returns>
|
||||
private static int RunMake(string arguments,
|
||||
out string standardOutput,
|
||||
out string standardError)
|
||||
{
|
||||
string make = "mingw32-make";
|
||||
string makeParameters = GetConfigurationOption("makeParameters", "");
|
||||
string reactosDirectory = Path.Combine(System.Environment.CurrentDirectory,
|
||||
"reactos");
|
||||
return RunScript(make,
|
||||
makeParameters + " " + arguments,
|
||||
reactosDirectory,
|
||||
GetEnvironmentVarables(),
|
||||
out standardOutput,
|
||||
out standardError);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verify a revision of ReactOS by building it all.
|
||||
/// </summary>
|
||||
private static int VerifyFull()
|
||||
{
|
||||
string standardOutput;
|
||||
string standardError;
|
||||
int exitCode = RunMake("bootcd",
|
||||
out standardOutput,
|
||||
out standardError);
|
||||
if (exitCode != 0)
|
||||
{
|
||||
Fail(String.Format("make bootcd failed: (error: {0}) {1}",
|
||||
standardError,
|
||||
standardOutput));
|
||||
return exitCode;
|
||||
}
|
||||
|
||||
string reactosDirectory = Path.Combine(System.Environment.CurrentDirectory,
|
||||
"reactos");
|
||||
string isoFilename = Path.Combine(reactosDirectory,
|
||||
"ReactOS.iso");
|
||||
if (!File.Exists(isoFilename))
|
||||
Fail("make bootcd produced no ReactOS.iso");
|
||||
|
||||
return exitCode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verify a revision of ReactOS by building parts.
|
||||
/// </summary>
|
||||
/// <param name="components">Comma separated list of components to build.</param>
|
||||
private static int VerifyPartial(string components)
|
||||
{
|
||||
string standardOutput;
|
||||
string standardError;
|
||||
string componentParameters = "\"" + components.Replace(",", "\" \"") + "\"";
|
||||
int exitCode = RunMake(componentParameters,
|
||||
out standardOutput,
|
||||
out standardError);
|
||||
if (exitCode != 0)
|
||||
Fail(String.Format("make failed for targets {0}: (error: {1}) {2}",
|
||||
componentParameters,
|
||||
standardError,
|
||||
standardOutput));
|
||||
return exitCode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verify a revision of ReactOS.
|
||||
/// </summary>
|
||||
/// <param name="args">Arguments from command line.</param>
|
||||
private static int Verify(string[] args)
|
||||
{
|
||||
if (args.Length > 0)
|
||||
return VerifyPartial(args[0]);
|
||||
else
|
||||
return VerifyFull();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Program entry point.
|
||||
/// </summary>
|
||||
/// <param name="args">Arguments from command line.</param>
|
||||
/// <remarks>
|
||||
/// If exit code is 0, then the commit was processed successfully.
|
||||
/// If exit code is 1, then the commit was not processed successfully.
|
||||
/// </remarks>
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
try
|
||||
{
|
||||
System.Environment.ExitCode = Verify(args);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string text = String.Format("Exception: {0}", ex);
|
||||
SendErrorMail("ReactOS Verify Error", text);
|
||||
System.Environment.ExitCode = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
145
cis/ReactOS.Verify/RedirectableProcess.cs
Normal file
145
cis/ReactOS.Verify/RedirectableProcess.cs
Normal file
@@ -0,0 +1,145 @@
|
||||
/*
|
||||
* When using the ProcessStartInfo.RedirectStandardXxx properties there is a chance of
|
||||
* the parent and child process blocking due to a race condition. This class handles the
|
||||
* problem.
|
||||
* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdiagnosticsprocessstartinfoclassredirectstandardoutputtopic.asp
|
||||
*/
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace ReactOS.Verify
|
||||
{
|
||||
/// <summary>
|
||||
/// Process that redirects standard output and standard error streams.
|
||||
/// </summary>
|
||||
public class RedirectableProcess
|
||||
{
|
||||
/// <summary>
|
||||
/// Process.
|
||||
/// </summary>
|
||||
private Process process;
|
||||
|
||||
/// <summary>
|
||||
/// Redirected standard error stream.
|
||||
/// </summary>
|
||||
private string processError;
|
||||
|
||||
/// <summary>
|
||||
/// Redirected standard output stream.
|
||||
/// </summary>
|
||||
private string processOutput;
|
||||
|
||||
/// <summary>
|
||||
/// Exit code.
|
||||
/// </summary>
|
||||
private int exitCode;
|
||||
|
||||
/// <summary>
|
||||
/// Redirected standard error stream.
|
||||
/// </summary>
|
||||
public string ProcessError
|
||||
{
|
||||
get
|
||||
{
|
||||
return processError;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Redirected standard output stream.
|
||||
/// </summary>
|
||||
public string ProcessOutput
|
||||
{
|
||||
get
|
||||
{
|
||||
return processOutput;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Exit code.
|
||||
/// </summary>
|
||||
public int ExitCode
|
||||
{
|
||||
get
|
||||
{
|
||||
return exitCode;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Run an excutable and redirect standard error and/or standard output safely.
|
||||
/// </summary>
|
||||
public RedirectableProcess(ProcessStartInfo processStartInfo)
|
||||
{
|
||||
Run(processStartInfo, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Run an excutable and redirect standard error and/or standard output safely.
|
||||
/// </summary>
|
||||
public RedirectableProcess(ProcessStartInfo processStartInfo, string input)
|
||||
{
|
||||
Run(processStartInfo, input);
|
||||
}
|
||||
|
||||
private void Run(ProcessStartInfo processStartInfo, string input)
|
||||
{
|
||||
process = new Process();
|
||||
process.StartInfo = processStartInfo;
|
||||
process.Start();
|
||||
if (processStartInfo.RedirectStandardInput && input != null)
|
||||
{
|
||||
process.StandardInput.AutoFlush = true;
|
||||
process.StandardInput.WriteLine(input);
|
||||
}
|
||||
Thread readStandardError = null;
|
||||
if (processStartInfo.RedirectStandardError)
|
||||
{
|
||||
readStandardError = new Thread(new ThreadStart(ReadStandardError));
|
||||
readStandardError.Start();
|
||||
}
|
||||
Thread readStandardOutput = null;
|
||||
if (processStartInfo.RedirectStandardOutput)
|
||||
{
|
||||
readStandardOutput = new Thread(new ThreadStart(ReadStandardOutput));
|
||||
readStandardOutput.Start();
|
||||
}
|
||||
if (processStartInfo.RedirectStandardError)
|
||||
{
|
||||
readStandardError.Join();
|
||||
}
|
||||
if (processStartInfo.RedirectStandardOutput)
|
||||
{
|
||||
readStandardOutput.Join();
|
||||
}
|
||||
process.WaitForExit();
|
||||
exitCode = process.ExitCode;
|
||||
process = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read standard error thread entry-point.
|
||||
/// </summary>
|
||||
private void ReadStandardError()
|
||||
{
|
||||
if (process != null)
|
||||
{
|
||||
processError = process.StandardError.ReadToEnd();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read standard output thread entry-point.
|
||||
/// </summary>
|
||||
private void ReadStandardOutput()
|
||||
{
|
||||
if (process != null)
|
||||
{
|
||||
processOutput = process.StandardOutput.ReadToEnd();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1 +1,27 @@
|
||||
semprini
|
||||
shit
|
||||
fuck
|
||||
pussy
|
||||
ass
|
||||
ass-
|
||||
-ass
|
||||
dumbass
|
||||
jackass
|
||||
fatass
|
||||
asshole
|
||||
smartass
|
||||
cunt
|
||||
fucker
|
||||
bitch
|
||||
dick
|
||||
penile
|
||||
stfu
|
||||
omfg
|
||||
lmao
|
||||
ass.
|
||||
-ass.
|
||||
semprini
|
||||
goat.cx
|
||||
ekush
|
||||
akshor
|
||||
poop
|
||||
guten morgen
|
||||
|
@@ -1,7 +1,5 @@
|
||||
<?xml version="1.0" ?>
|
||||
<HresultList>
|
||||
<Hresult text="S_OK" value="00000000" />
|
||||
<Hresult text="S_FALSE" value="00000001" />
|
||||
<Hresult text="STG_S_CONVERTED" value="00030200" />
|
||||
<Hresult text="STG_S_BLOCK" value="00030201" />
|
||||
<Hresult text="STG_S_RETRYNOW" value="00030202" />
|
||||
|
@@ -2,69 +2,8 @@
|
||||
<NtstatusList>
|
||||
<Ntstatus text="STATUS_SUCCESS" value="00000000"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0" value="00000000"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 1" value="00000001"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 2" value="00000002"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 3" value="00000003"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 4" value="00000004"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 5" value="00000005"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 6" value="00000006"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 7" value="00000007"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 8" value="00000008"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 9" value="00000009"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 10" value="0000000A"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 11" value="0000000B"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 12" value="0000000C"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 13" value="0000000D"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 14" value="0000000E"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 15" value="0000000F"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 16" value="00000010"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 17" value="00000011"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 18" value="00000012"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 19" value="00000013"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 20" value="00000014"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 21" value="00000015"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 22" value="00000016"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 23" value="00000017"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 24" value="00000018"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 25" value="00000019"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 26" value="0000001A"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 27" value="0000001B"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 28" value="0000001C"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 29" value="0000001D"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 30" value="0000001E"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 31" value="0000001F"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 32" value="00000020"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 33" value="00000021"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 34" value="00000022"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 35" value="00000023"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 36" value="00000024"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 37" value="00000025"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 38" value="00000026"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 39" value="00000027"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 40" value="00000028"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 41" value="00000029"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 42" value="0000002A"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 43" value="0000002B"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 44" value="0000002C"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 45" value="0000002D"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 46" value="0000002E"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 47" value="0000002F"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 48" value="00000030"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 49" value="00000031"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 50" value="00000032"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 51" value="00000033"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 52" value="00000034"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 53" value="00000035"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 54" value="00000036"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 55" value="00000037"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 56" value="00000038"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 57" value="00000039"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 58" value="0000003A"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 59" value="0000003B"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 60" value="0000003C"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 61" value="0000003D"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 62" value="0000003E"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_0 + 63" value="0000003F"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_1" value="00000001"></Ntstatus>
|
||||
<Ntstatus text="STATUS_WAIT_63" value="0000003F"></Ntstatus>
|
||||
<Ntstatus text="STATUS_ABANDONED" value="00000080"></Ntstatus>
|
||||
<Ntstatus text="STATUS_ABANDONED_WAIT_0" value="00000080"></Ntstatus>
|
||||
<Ntstatus text="STATUS_ABANDONED_WAIT_63" value="000000BF"></Ntstatus>
|
||||
|
@@ -8,10 +8,10 @@
|
||||
<add key="IRCBotPassword" value="MyPassword" />
|
||||
<add key="ChmPath" value="C:\IRC\TechBot\CHM" />
|
||||
<add key="MainChm" value="kmarch.chm" />
|
||||
<add key="NtstatusXml" value="ntstatus.xml" />
|
||||
<add key="WinerrorXml" value="winerror.xml" />
|
||||
<add key="HresultXml" value="hresult.xml" />
|
||||
<add key="WmXml" value="wm.xml" />
|
||||
<add key="NtstatusXml" value="C:\IRC\TechBot\ntstatus.xml" />
|
||||
<add key="WinerrorXml" value="C:\IRC\TechBot\winerror.xml" />
|
||||
<add key="HresultXml" value="C:\IRC\TechBot\hresult.xml" />
|
||||
<add key="WmXml" value="C:\IRC\TechBot\wm.xml" />
|
||||
<add key="SvnCommand" value="svn co svn://svn.reactos.org/trunk/reactos" />
|
||||
<add key="BugUrl" value="http://www.reactos.org/bugzilla/show_bug.cgi?id={0}" />
|
||||
<add key="WineBugUrl" value="http://bugs.winehq.org/show_bug.cgi?id={0}" />
|
||||
|
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Xml;
|
||||
using System.Collections;
|
||||
|
||||
namespace TechBot.Library
|
||||
{
|
||||
@@ -29,170 +28,58 @@ namespace TechBot.Library
|
||||
new string[] { "error" });
|
||||
}
|
||||
|
||||
private static int GetSeverity(long error)
|
||||
{
|
||||
return (int)((error >> 30) & 0x3);
|
||||
}
|
||||
|
||||
private static bool IsCustomer(long error)
|
||||
{
|
||||
return (error & 0x20000000) != 0;
|
||||
}
|
||||
|
||||
private static bool IsReserved(long error)
|
||||
{
|
||||
return (error & 0x10000000) != 0;
|
||||
}
|
||||
|
||||
private static int GetFacility(long error)
|
||||
{
|
||||
return (int)((error >> 16) & 0xFFF);
|
||||
}
|
||||
|
||||
private static short GetCode(long error)
|
||||
{
|
||||
return (short)((error >> 0) & 0xFFFF);
|
||||
}
|
||||
|
||||
private static string FormatSeverity(long error)
|
||||
{
|
||||
int severity = GetSeverity(error);
|
||||
switch (severity)
|
||||
{
|
||||
case 0: return "SUCCESS";
|
||||
case 1: return "INFORMATIONAL";
|
||||
case 2: return "WARNING";
|
||||
case 3: return "ERROR";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static string FormatFacility(long error)
|
||||
{
|
||||
int facility = GetFacility(error);
|
||||
return facility.ToString();
|
||||
}
|
||||
|
||||
private static string FormatCode(long error)
|
||||
{
|
||||
int code = GetCode(error);
|
||||
return code.ToString();
|
||||
}
|
||||
|
||||
public void Handle(MessageContext context,
|
||||
string commandName,
|
||||
string parameters)
|
||||
{
|
||||
string originalErrorText = parameters.Trim();
|
||||
if (originalErrorText.Equals(String.Empty))
|
||||
string errorText = parameters;
|
||||
if (errorText.Equals(String.Empty))
|
||||
{
|
||||
serviceOutput.WriteLine(context,
|
||||
"Please provide an Error Code.");
|
||||
return;
|
||||
}
|
||||
|
||||
string errorText = originalErrorText;
|
||||
|
||||
retry:
|
||||
NumberParser np = new NumberParser();
|
||||
long error = np.Parse(errorText);
|
||||
if (np.Error)
|
||||
{
|
||||
serviceOutput.WriteLine(context,
|
||||
String.Format("{0} is not a valid Error Code.",
|
||||
originalErrorText));
|
||||
errorText));
|
||||
return;
|
||||
}
|
||||
|
||||
ArrayList descriptions = new ArrayList();
|
||||
|
||||
// Error is out of bounds
|
||||
if ((ulong)error > uint.MaxValue)
|
||||
string description = null;
|
||||
if (winerror.GetWinerrorDescription(error) != null)
|
||||
{
|
||||
// Do nothing
|
||||
}
|
||||
// Error is outside of the range [0, 65535]: it cannot be a plain Win32 error code
|
||||
else if ((ulong)error > ushort.MaxValue)
|
||||
{
|
||||
// Customer bit is set: custom error code
|
||||
if (IsCustomer(error))
|
||||
{
|
||||
string description = String.Format("[custom, severity {0}, facility {1}, code {2}]",
|
||||
FormatSeverity(error),
|
||||
FormatFacility(error),
|
||||
FormatCode(error));
|
||||
descriptions.Add(description);
|
||||
}
|
||||
// Reserved bit is set: HRESULT_FROM_NT(ntstatus)
|
||||
else if (IsReserved(error))
|
||||
{
|
||||
int status = (int)(error & 0xCFFFFFFF);
|
||||
string description = ntStatus.GetNtstatusDescription(status);
|
||||
|
||||
if (description == null)
|
||||
description = status.ToString("X");
|
||||
|
||||
description = String.Format("HRESULT_FROM_NT({0})", description);
|
||||
descriptions.Add(description);
|
||||
}
|
||||
// Win32 facility: HRESULT_FROM_WIN32(winerror)
|
||||
else if (GetFacility(error) == 7)
|
||||
{
|
||||
// Must be an error code
|
||||
if (GetSeverity(error) == 2)
|
||||
{
|
||||
short err = GetCode(error);
|
||||
string description = winerror.GetWinerrorDescription(err);
|
||||
|
||||
if (description == null)
|
||||
description = err.ToString("D");
|
||||
|
||||
description = String.Format("HRESULT_FROM_WIN32({0})", description);
|
||||
descriptions.Add(description);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
string winerrorDescription = winerror.GetWinerrorDescription(error);
|
||||
string ntstatusDescription = ntStatus.GetNtstatusDescription(error);
|
||||
string hresultDescription = hresult.GetHresultDescription(error);
|
||||
|
||||
if (winerrorDescription != null)
|
||||
descriptions.Add(winerrorDescription);
|
||||
if (ntstatusDescription != null)
|
||||
descriptions.Add(ntstatusDescription);
|
||||
if (hresultDescription != null)
|
||||
descriptions.Add(hresultDescription);
|
||||
|
||||
if (descriptions.Count == 0)
|
||||
{
|
||||
// Last chance heuristics: attempt to parse a 8-digit decimal as hexadecimal
|
||||
if (errorText.Length == 8)
|
||||
{
|
||||
errorText = "0x" + errorText;
|
||||
goto retry;
|
||||
}
|
||||
|
||||
description = winerror.GetWinerrorDescription(error);
|
||||
serviceOutput.WriteLine(context,
|
||||
String.Format("I don't know about Error Code {0}.",
|
||||
originalErrorText));
|
||||
String.Format("{0} is {1}.",
|
||||
error,
|
||||
description));
|
||||
}
|
||||
else if (descriptions.Count == 1)
|
||||
if (ntStatus.GetNtstatusDescription(error) != null)
|
||||
{
|
||||
string description = (string)descriptions[0];
|
||||
description = ntStatus.GetNtstatusDescription(error);
|
||||
serviceOutput.WriteLine(context,
|
||||
String.Format("{0} is {1}.",
|
||||
originalErrorText,
|
||||
errorText,
|
||||
description));
|
||||
}
|
||||
else
|
||||
if (hresult.GetHresultDescription(error) != null)
|
||||
{
|
||||
description = hresult.GetHresultDescription(error);
|
||||
serviceOutput.WriteLine(context,
|
||||
String.Format("{0} is {1}.",
|
||||
errorText,
|
||||
description));
|
||||
}
|
||||
if(description == null)
|
||||
{
|
||||
serviceOutput.WriteLine(context,
|
||||
String.Format("{0} could be:",
|
||||
originalErrorText));
|
||||
|
||||
foreach(string description in descriptions)
|
||||
serviceOutput.WriteLine(context, String.Format("\t{0}", description));
|
||||
String.Format("I don't know about Error Code {0}.",
|
||||
errorText));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -6,12 +6,14 @@ namespace TechBot.Library
|
||||
public class HresultCommand : BaseCommand, ICommand
|
||||
{
|
||||
private IServiceOutput serviceOutput;
|
||||
private string hresultXml;
|
||||
private XmlDocument hresultXmlDocument;
|
||||
|
||||
public HresultCommand(IServiceOutput serviceOutput,
|
||||
string hresultXml)
|
||||
{
|
||||
this.serviceOutput = serviceOutput;
|
||||
this.hresultXml = hresultXml;
|
||||
hresultXmlDocument = new XmlDocument();
|
||||
hresultXmlDocument.Load(hresultXml);
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@ namespace TechBot.Library
|
||||
|
||||
private const string SpecialHexCharacters = "ABCDEF";
|
||||
|
||||
private static bool IsSpecialHexCharacter(char ch)
|
||||
private bool IsSpecialHexCharacter(char ch)
|
||||
{
|
||||
foreach (char specialChar in SpecialHexCharacters)
|
||||
{
|
||||
@@ -19,7 +19,7 @@ namespace TechBot.Library
|
||||
return false;
|
||||
}
|
||||
|
||||
private static bool HasSpecialHexCharacters(string s)
|
||||
private bool HasSpecialHexCharacters(string s)
|
||||
{
|
||||
foreach (char ch in s)
|
||||
{
|
||||
@@ -35,7 +35,7 @@ namespace TechBot.Library
|
||||
{
|
||||
Error = false;
|
||||
bool useHex = false;
|
||||
if (s.StartsWith("0x", StringComparison.InvariantCultureIgnoreCase))
|
||||
if (s.StartsWith("0x"))
|
||||
{
|
||||
s = s.Substring(2);
|
||||
useHex = true;
|
||||
|
@@ -49,9 +49,9 @@ namespace TechBot.Library
|
||||
{
|
||||
commands.Add(new HelpCommand(serviceOutput,
|
||||
commands));
|
||||
/*commands.Add(new ApiCommand(serviceOutput,
|
||||
commands.Add(new ApiCommand(serviceOutput,
|
||||
chmPath,
|
||||
mainChm));*/
|
||||
mainChm));
|
||||
commands.Add(new NtStatusCommand(serviceOutput,
|
||||
ntstatusXml));
|
||||
commands.Add(new WinerrorCommand(serviceOutput,
|
||||
|
2
msvc6/.cvsignore
Normal file
2
msvc6/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
||||
*.ncb
|
||||
*.opt
|
102
msvc6/README.txt
Normal file
102
msvc6/README.txt
Normal file
@@ -0,0 +1,102 @@
|
||||
ReactOS Microsoft Visual C/C++ 6.0 IDE files
|
||||
|
||||
This is the Microsoft Visual C/C++ 6.0 project workspace and project
|
||||
files for a few of the ReactOS binaries. They are ONLY included as a
|
||||
convenience, and is NOT to be considered supported, or even correct.
|
||||
If you build a binary that misbehaves using these files, you _might_
|
||||
be able to get in touch with someone to fix the problem
|
||||
BUT DO NOT COUNT ON IT!
|
||||
|
||||
The only supported build system for ReactOS is the one documented at
|
||||
www.reactos.com.
|
||||
|
||||
------------------------------------------------------------------
|
||||
Please, before you start playing with this, read the whole of
|
||||
this document.
|
||||
|
||||
Before you can use these project files, you _need_ to make a successful
|
||||
build using the normal ReactOS build system. There are some vital files
|
||||
that needs to be created, and currently only the normal build creates these.
|
||||
|
||||
Once that is done, you need to generate the kernel-mode service "table"
|
||||
file by running nmake (from this point on you can use the "native"
|
||||
MSVC tools) from the directory MSVC6\iface\native.
|
||||
This will generate MSVC6\ntoskrnl\nt_zw_msvc.c, an MSVC compatible inline-
|
||||
assembler version of the file otherwise known as reactos\ntoskrnl\nt\zw.c.
|
||||
|
||||
Next, go to def_converter and run nmake. This builds the tool to convert
|
||||
the .def files for HAL and the kernel from the MinGW format to something
|
||||
more suitable for the MSVC linker, and also generates these .def files
|
||||
to their target location [1].
|
||||
|
||||
Now you should be set to fire up the IDE and load the project workspace.
|
||||
|
||||
|
||||
When building HAL or the kernel for the first time using these
|
||||
project files, just doing it the "normal" way _will not work_.
|
||||
The linker will complain about missing library, and it will fail.
|
||||
|
||||
The reason for this is a circular dependency between these two binaries.
|
||||
|
||||
Currently you need to follow these procedures [2]:
|
||||
|
||||
- Select hal as your active project.
|
||||
- Select Project/Settings.
|
||||
- Select the Link tab.
|
||||
- Select "General" from the Category drop-list.
|
||||
- Temporary remove the explicit linker library
|
||||
(e.g. "..\ntoskrnl\Debug\ntoskrnl.lib")
|
||||
- Select "Customize" from the Category drop-list.
|
||||
- Check the "Force file output" checkbox.
|
||||
- Build hal.
|
||||
- Uncheck "Force file output".
|
||||
- Put back the removed import library.
|
||||
- Now build the ntoskrnl. Do NOT try to build hal again until
|
||||
you have sucessfully built the kernel, and the linker has
|
||||
generated its import library!
|
||||
- Now you can "Clean" hal, and build it as usual.
|
||||
|
||||
If everything worked as expected, you should now have both ntoskrnl.exe
|
||||
and hal.dll freshly built.
|
||||
|
||||
|
||||
LIMITATIONS/DEVIATIONS (from the MinGW build):
|
||||
- Since there can only be one resource file/project, the kernel had
|
||||
to choose between either its version resource, or its message table.
|
||||
The messages won.
|
||||
- Do NOT open the .rc files in the IDE's resource editor. Chances are
|
||||
it will assume ownership over them and fill them up with at least
|
||||
conditional compilation macros.
|
||||
|
||||
|
||||
NOTES:
|
||||
|
||||
[1] This is needed due to differences in handling of decorated names
|
||||
in .def files. While both MinGW GCC and MSVC generates decorated names
|
||||
in the same way for at least plain cdecl and stdcall C functions, the
|
||||
MSVC linker expects names in the .def file to be either
|
||||
|
||||
- an exact match of the decorated name, in case it exports the
|
||||
decorated name from the linked binary, or
|
||||
- just the name without any decoration, in case it exports just the
|
||||
name of the symbol from the linked binary (to allow for e.g.
|
||||
GetProcAddress using the undecorated name) - but keeps the decorated
|
||||
names in the import library to handle and "redirect" linker requests
|
||||
for those decorated symbols, and point them to the undercorated names
|
||||
in the binary exporting them - so that a binary A, at link time,
|
||||
importing symbols from binary B of the form "_name@0" will resolve
|
||||
that symbol from the import library, but the linked binary A will
|
||||
reference it as just "name".
|
||||
|
||||
The ROS .def files contains a mix, "half-decorated", where the leading
|
||||
undescores are missing, but the trailing "@n" (for stdcall functions)
|
||||
are present.
|
||||
|
||||
|
||||
[2] Theoretically it could be possible to use a hal.lib generated by the
|
||||
following procedure, removing the need for the manual steps above.
|
||||
|
||||
cd MSVC6\hal\Debug
|
||||
lib \def:..\..\..\reactos\hal\hal\hal.def
|
||||
|
||||
but I have not tested it, and take no responsibility for its effectiveness.
|
41
msvc6/ReactOS.dsw
Normal file
41
msvc6/ReactOS.dsw
Normal file
@@ -0,0 +1,41 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "hal"=.\hal\hal.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "ntoskrnl"=.\ntoskrnl\ntoskrnl.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
64
msvc6/def_converter/def_converter.cpp
Normal file
64
msvc6/def_converter/def_converter.cpp
Normal file
@@ -0,0 +1,64 @@
|
||||
// Uses hard-coded filenames to require a minimum of input.
|
||||
// You think this file should be licensed? OK then,
|
||||
// Copyright (C) 2004, Mike Nordell. Use as you whish.
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <algorithm>
|
||||
|
||||
const char szSrc1[] = "..\\..\\reactos\\ntoskrnl\\ntoskrnl.def";
|
||||
const char szDst1[] = "..\\ntoskrnl\\ntoskrnl.def";
|
||||
const char szSrc2[] = "..\\..\\reactos\\hal\\hal\\hal.def";
|
||||
const char szDst2[] = "..\\hal\\hal.def";
|
||||
|
||||
enum File
|
||||
{
|
||||
Kernel,
|
||||
HAL
|
||||
};
|
||||
|
||||
std::string do_kernel_replacements(std::string& s)
|
||||
{
|
||||
std::string s2 = s.c_str(); // to fixup size after replacements
|
||||
if (s2 == "ExAllocateFromPagedLookasideList") {
|
||||
s2 += "=ExiAllocateFromPagedLookasideList";
|
||||
} else
|
||||
if (s2 == "ExFreeToPagedLookasideList") {
|
||||
s2 += "=ExiFreeToPagedLookasideList";
|
||||
} else
|
||||
if (s2 == "MmLockPagableImageSection") {
|
||||
s2 += "=MmLockPagableDataSection";
|
||||
}
|
||||
return s2;
|
||||
}
|
||||
|
||||
void convert_def(const char* szSrc, const char* szDst, File file)
|
||||
{
|
||||
using namespace std;
|
||||
ifstream in(szSrc);
|
||||
ofstream out(szDst);
|
||||
string s;
|
||||
while (getline(in, s).good()) {
|
||||
if (!s.size()) {
|
||||
continue;
|
||||
}
|
||||
if (s[0] != ';') { // only replace non-comment lines
|
||||
if (s[0] == '@') {
|
||||
s.erase(0, 1);
|
||||
}
|
||||
replace(s.begin(), s.end(), '@', '\0');
|
||||
if (file == Kernel) {
|
||||
s = do_kernel_replacements(s);
|
||||
}
|
||||
}
|
||||
out << s << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
convert_def(szSrc1, szDst1, Kernel);
|
||||
convert_def(szSrc2, szDst2, HAL);
|
||||
return 0;
|
||||
}
|
||||
|
19
msvc6/def_converter/makefile
Normal file
19
msvc6/def_converter/makefile
Normal file
@@ -0,0 +1,19 @@
|
||||
# $Id: makefile,v 1.1 2004/02/06 08:21:54 fireball Exp $
|
||||
#
|
||||
# ReactOS Operating System - .def converter for HAL and the kernel
|
||||
#
|
||||
|
||||
DEF_HAL = ..\hal\hal.def
|
||||
DEF_KRNL = ..\ntoskrnl\ntoskrnl.def
|
||||
CPPFLAGS = /GX
|
||||
|
||||
all: def_converter.exe $(DEF_HAL) $(DEF_KRNL)
|
||||
|
||||
$(DEF_HAL) : ..\..\reactos\hal\hal\hal.def
|
||||
def_converter.exe
|
||||
|
||||
$(DEF_KRNL) : ..\..\reactos\ntoskrnl\ntoskrnl.def
|
||||
def_converter.exe
|
||||
|
||||
def_converter.exe : def_converter.cpp
|
||||
|
3
msvc6/hal/.cvsignore
Normal file
3
msvc6/hal/.cvsignore
Normal file
@@ -0,0 +1,3 @@
|
||||
Debug
|
||||
Release
|
||||
hal.def
|
243
msvc6/hal/hal.dsp
Normal file
243
msvc6/hal/hal.dsp
Normal file
@@ -0,0 +1,243 @@
|
||||
# Microsoft Developer Studio Project File - Name="hal" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||
|
||||
CFG=hal - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "hal.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "hal.mak" CFG="hal - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "hal - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "hal - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "hal - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HAL_EXPORTS" /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /Ot /Og /Os /Ob1 /I "..\..\reactos\include" /I "..\..\reactos\hal\halx86\include" /I "..\..\reactos\ntoskrnl\include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "i386" /D "__NTHAL__" /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x41d /d "NDEBUG"
|
||||
# ADD RSC /l 0x417 /i "..\..\reactos\include" /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /dll /machine:I386
|
||||
# ADD LINK32 ..\ntoskrnl\Release\ntoskrnl.lib /nologo /dll /machine:I386 /fixed:no
|
||||
# SUBTRACT LINK32 /pdb:none /force
|
||||
|
||||
!ELSEIF "$(CFG)" == "hal - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HAL_EXPORTS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W3 /Z7 /Od /I "..\..\reactos\include" /I "..\..\reactos\hal\halx86\include" /I "..\..\reactos\ntoskrnl\include" /D "_WINDOWS" /D "__NTHAL__" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "i386" /FD /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x41d /d "_DEBUG"
|
||||
# ADD RSC /l 0x417 /i "..\..\reactos\include" /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /dll /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 ..\ntoskrnl\Debug\ntoskrnl.lib /nologo /dll /incremental:no /debug /machine:I386 /pdbtype:sept /fixed:no
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "hal - Win32 Release"
|
||||
# Name "hal - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\reactos\hal\halx86\adapter.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\reactos\hal\halx86\beep.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\reactos\hal\halx86\bus.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\reactos\hal\halx86\display.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\reactos\hal\halx86\dma.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\reactos\hal\halx86\drive.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\reactos\hal\halx86\enum.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\reactos\hal\halx86\fmutex.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\reactos\hal\halx86\fmutex_tmn.c
|
||||
# PROP Exclude_From_Build 1
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\reactos\hal\halx86\halinit.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\reactos\hal\halx86\halx86mp.rc
|
||||
# PROP Exclude_From_Build 1
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\reactos\hal\halx86\halx86up.rc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\reactos\hal\halx86\irql.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\reactos\hal\halx86\isa.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\reactos\hal\halx86\kdbg.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\reactos\hal\halx86\mca.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\reactos\hal\halx86\misc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\reactos\hal\halx86\mp.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\reactos\hal\halx86\mpsirql.c
|
||||
# PROP Exclude_From_Build 1
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\reactos\hal\halx86\pci.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\reactos\hal\halx86\portio.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\reactos\hal\halx86\pwroff.c
|
||||
# PROP Exclude_From_Build 1
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\reactos\hal\halx86\reboot.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\reactos\hal\halx86\spinlock.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\reactos\hal\halx86\spinlock_tmn.c
|
||||
# PROP Exclude_From_Build 1
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\reactos\hal\halx86\sysbus.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\reactos\hal\halx86\sysinfo.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\reactos\hal\halx86\time.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\reactos\hal\halx86\timer.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "include"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\reactos\hal\halx86\include\bus.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\reactos\hal\halx86\include\hal.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\reactos\hal\halx86\include\mps.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\hal.def
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
392
msvc6/iface/native/genntdll.c
Normal file
392
msvc6/iface/native/genntdll.c
Normal file
@@ -0,0 +1,392 @@
|
||||
/* $Id: genntdll.c,v 1.1 2004/02/06 08:21:56 fireball Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS version of ntdll
|
||||
* FILE: iface/native/genntdll.c
|
||||
* PURPOSE: Generates the system call stubs in ntdll
|
||||
* CHANGE HISTORY: Added a '@xx' to deal with stdcall [ Ariadne ]
|
||||
* 19990616 (ea)
|
||||
* Four arguments now required; 4th is the file
|
||||
* for ntoskrnl ZwXXX functions (which are merely calls
|
||||
* to twin NtXXX calls, via int 0x2e (x86).
|
||||
* 19990617 (ea)
|
||||
* Fixed a bug in function numbers in kernel ZwXXX stubs.
|
||||
*
|
||||
*/
|
||||
|
||||
/* INCLUDE ******************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define PARAMETERIZED_LIBS
|
||||
|
||||
/* #define VERBOSE */
|
||||
|
||||
#define INPUT_BUFFER_SIZE 255
|
||||
|
||||
/* FUNCTIONS ****************************************************************/
|
||||
|
||||
void write_syscall_stub(FILE* out, FILE* out3, char* name, char* name2,
|
||||
char* nr_args, unsigned int sys_call_idx)
|
||||
{
|
||||
int i;
|
||||
int nArgBytes = atoi(nr_args);
|
||||
#ifdef PARAMETERIZED_LIBS
|
||||
fprintf(out,"__asm__(\"\\n\\t.global _%s@%s\\n\\t\"\n",name,nr_args);
|
||||
fprintf(out,"\".global _%s@%s\\n\\t\"\n",name2,nr_args);
|
||||
fprintf(out,"\"_%s@%s:\\n\\t\"\n",name,nr_args);
|
||||
fprintf(out,"\"_%s@%s:\\n\\t\"\n",name2,nr_args);
|
||||
#else
|
||||
fprintf(out,"__asm__(\"\\n\\t.global _%s\\n\\t\"\n",name);
|
||||
fprintf(out,"\".global _%s\\n\\t\"\n",name2);
|
||||
fprintf(out,"\"_%s:\\n\\t\"\n",name);
|
||||
fprintf(out,"\"_%s:\\n\\t\"\n",name2);
|
||||
#endif
|
||||
fprintf(out,"\t\"pushl\t%%ebp\\n\\t\"\n");
|
||||
fprintf(out,"\t\"movl\t%%esp, %%ebp\\n\\t\"\n");
|
||||
fprintf(out,"\t\"mov\t$%d,%%eax\\n\\t\"\n",sys_call_idx);
|
||||
fprintf(out,"\t\"lea\t8(%%ebp),%%edx\\n\\t\"\n");
|
||||
fprintf(out,"\t\"int\t$0x2E\\n\\t\"\n");
|
||||
fprintf(out,"\t\"popl\t%%ebp\\n\\t\"\n");
|
||||
fprintf(out,"\t\"ret\t$%s\\n\\t\");\n\n",nr_args);
|
||||
|
||||
/*
|
||||
* Now write the NTOSKRNL stub for the
|
||||
* current system call. ZwXXX does NOT
|
||||
* alias the corresponding NtXXX call.
|
||||
*/
|
||||
#if 0
|
||||
fprintf(out3,"__asm__(\n");
|
||||
fprintf(out3,"\".global _%s@%s\\n\\t\"\n",name2,nr_args);
|
||||
fprintf(out3,"\"_%s@%s:\\n\\t\"\n",name2,nr_args);
|
||||
fprintf(out3,"\t\"pushl\t%%ebp\\n\\t\"\n");
|
||||
fprintf(out3,"\t\"movl\t%%esp, %%ebp\\n\\t\"\n");
|
||||
fprintf(out3,"\t\"mov\t$%d,%%eax\\n\\t\"\n",sys_call_idx);
|
||||
fprintf(out3,"\t\"lea\t8(%%ebp),%%edx\\n\\t\"\n");
|
||||
fprintf(out3,"\t\"int\t$0x2E\\n\\t\"\n");
|
||||
fprintf(out3,"\t\"popl\t%%ebp\\n\\t\"\n");
|
||||
fprintf(out3,"\t\"ret\t$%s\\n\\t\");\n\n",nr_args);
|
||||
#else
|
||||
fprintf(out3,"__declspec(naked) __stdcall\n");
|
||||
fprintf(out3,"%s(", name2); // make it emit callconv, reval and full signature too
|
||||
for (i=0; i*4 < nArgBytes; ++i) {
|
||||
fprintf(out3,"int dummy%d", i);
|
||||
if (((i+1)*4) < nArgBytes) fprintf(out3,",");
|
||||
}
|
||||
fprintf(out3,")\n{\n");
|
||||
fprintf(out3,"\t__asm {\n");
|
||||
fprintf(out3,"\t\tpush\tebp\n");
|
||||
fprintf(out3,"\t\tmov\tebp, esp\n");
|
||||
fprintf(out3,"\t\tmov\teax,%d\n",sys_call_idx);
|
||||
fprintf(out3,"\t\tlea\tedx, 8[ebp]\n");
|
||||
fprintf(out3,"\t\tint\t0x2E\n");
|
||||
fprintf(out3,"\t\tpop\tebp\n");
|
||||
fprintf(out3,"\t\tret\t%s\n",nr_args);
|
||||
fprintf(out3,"\t}\n");
|
||||
fprintf(out3,"}\n\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
int makeSystemServiceTable(FILE *in, FILE *out)
|
||||
{
|
||||
char line [INPUT_BUFFER_SIZE];
|
||||
char *s;
|
||||
char *name;
|
||||
char *name2;
|
||||
int sys_call_idx;
|
||||
char *nr_args;
|
||||
char *stmp;
|
||||
|
||||
/*
|
||||
* Main SSDT Header
|
||||
*/
|
||||
fprintf(out,"// Machine generated, don't edit\n");
|
||||
fprintf(out,"\n\n");
|
||||
|
||||
/*
|
||||
* First we build the Main SSDT
|
||||
*/
|
||||
fprintf(out,"\n\n\n");
|
||||
fprintf(out,"SSDT MainSSDT[] = {\n");
|
||||
|
||||
for ( /* First system call has index zero */
|
||||
sys_call_idx = 0;
|
||||
/* Go on until EOF or read zero bytes */
|
||||
( (!feof(in))
|
||||
&& (fgets(line, sizeof line, in) != NULL)
|
||||
);
|
||||
/* Next system call index */
|
||||
sys_call_idx++
|
||||
)
|
||||
{
|
||||
if ((s = (char *) strchr(line,'\r')) != NULL)
|
||||
{
|
||||
*s = '\0';
|
||||
}
|
||||
/*
|
||||
* Skip comments (#) and empty lines.
|
||||
*/
|
||||
s = & line[0];
|
||||
if ((*s) != '#' && (*s) != '\0')
|
||||
{
|
||||
/* Extract the NtXXX name */
|
||||
name = (char *)strtok(s," \t");
|
||||
/* Extract the ZwXXX name */
|
||||
name2 = (char *)strtok(NULL," \t");
|
||||
//value = strtok(NULL," \t");
|
||||
/* Extract the stack size */
|
||||
nr_args = (char *)strtok(NULL," \t");
|
||||
/*
|
||||
* Remove, if present, the trailing LF.
|
||||
*/
|
||||
if ((stmp = strchr(nr_args, '\n')) != NULL)
|
||||
{
|
||||
*stmp = '\0';
|
||||
}
|
||||
#ifdef VERBOSE
|
||||
printf("%3d \"%s\"\n",sys_call_idx,name);
|
||||
#endif
|
||||
|
||||
if (sys_call_idx > 0)
|
||||
{
|
||||
fprintf(out,",\n");
|
||||
}
|
||||
/*
|
||||
* Now write the current system call's name
|
||||
* in the service table.
|
||||
*/
|
||||
fprintf(out,"\t\t{ (ULONG)%s }",name);
|
||||
}
|
||||
}
|
||||
/* Close the service table (C syntax) */
|
||||
fprintf(out,"\n};\n");
|
||||
|
||||
/*
|
||||
* Now we build the Main SSPT
|
||||
*/
|
||||
rewind(in);
|
||||
fprintf(out,"\n\n\n");
|
||||
fprintf(out,"SSPT MainSSPT[] = {\n");
|
||||
|
||||
for ( /* First system call has index zero */
|
||||
sys_call_idx = 0;
|
||||
/* Go on until EOF or read zero bytes */
|
||||
( (!feof(in))
|
||||
&& (fgets(line, sizeof line, in) != NULL)
|
||||
);
|
||||
/* Next system call index */
|
||||
sys_call_idx++
|
||||
)
|
||||
{
|
||||
if ((s = (char *) strchr(line,'\r')) != NULL)
|
||||
{
|
||||
*s = '\0';
|
||||
}
|
||||
/*
|
||||
* Skip comments (#) and empty lines.
|
||||
*/
|
||||
s = & line[0];
|
||||
if ((*s) != '#' && (*s) != '\0')
|
||||
{
|
||||
/* Extract the NtXXX name */
|
||||
name = (char *)strtok(s," \t");
|
||||
/* Extract the ZwXXX name */
|
||||
name2 = (char *)strtok(NULL," \t");
|
||||
//value = strtok(NULL," \t");
|
||||
/* Extract the stack size */
|
||||
nr_args = (char *)strtok(NULL," \t");
|
||||
/*
|
||||
* Remove, if present, the trailing LF.
|
||||
*/
|
||||
if ((stmp = strchr(nr_args, '\n')) != NULL)
|
||||
{
|
||||
*stmp = '\0';
|
||||
}
|
||||
#ifdef VERBOSE
|
||||
printf("%3d \"%s\"\n",sys_call_idx,name);
|
||||
#endif
|
||||
|
||||
if (sys_call_idx > 0)
|
||||
{
|
||||
fprintf(out,",\n");
|
||||
}
|
||||
/*
|
||||
* Now write the current system call's ID
|
||||
* in the service table along with its Parameters Size.
|
||||
*/
|
||||
fprintf(out,"\t\t{ %s }",nr_args);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Close the service table (C syntax)
|
||||
*/
|
||||
fprintf(out,"\n};\n");
|
||||
|
||||
/*
|
||||
* We write some useful defines
|
||||
*/
|
||||
fprintf(out, "\n\n#define MIN_SYSCALL_NUMBER 0\n");
|
||||
fprintf(out, "#define MAX_SYSCALL_NUMBER %d\n", sys_call_idx-1);
|
||||
fprintf(out, "#define NUMBER_OF_SYSCALLS %d\n", sys_call_idx);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
process(
|
||||
FILE * in,
|
||||
FILE * out,
|
||||
FILE * out2,
|
||||
FILE * out3
|
||||
)
|
||||
{
|
||||
char line [INPUT_BUFFER_SIZE];
|
||||
char * s;
|
||||
char * name; /* NtXXX name */
|
||||
char * name2; /* ZwXXX name */
|
||||
int sys_call_idx; /* NtXXX index number in the service table */
|
||||
char * nr_args; /* stack_size / machine_word_size */
|
||||
char * stmp;
|
||||
|
||||
/*
|
||||
* NTDLL stubs file header
|
||||
*/
|
||||
fprintf(out,"// Machine generated, don't edit\n");
|
||||
fprintf(out,"\n\n");
|
||||
|
||||
/*
|
||||
* NTOSKRNL Zw functions stubs header
|
||||
*/
|
||||
fprintf(out3,"// Machine generated by genntdll, don't edit\n");
|
||||
fprintf(out3,"\n\n");
|
||||
/*
|
||||
* Scan the database. DB is a text file; each line
|
||||
* is a record, which contains data for one system
|
||||
* function. Each record has three columns:
|
||||
*
|
||||
* NT_NAME (e.g. NtCreateProcess)
|
||||
* ZW_NAME (e.g. ZwCreateProcess)
|
||||
* STACK_SIZE (in machine words: for x[3456]86
|
||||
* processors a machine word is 4 bytes)
|
||||
*/
|
||||
for ( /* First system call has index zero */
|
||||
sys_call_idx = 0;
|
||||
/* Go on until EOF or read zero bytes */
|
||||
( (!feof(in))
|
||||
&& (fgets(line, sizeof line, in) != NULL)
|
||||
);
|
||||
/* Next system call index */
|
||||
sys_call_idx++
|
||||
)
|
||||
{
|
||||
/*
|
||||
* Remove, if present, the trailing CR.
|
||||
* (os specific?)
|
||||
*/
|
||||
if ((s = (char *) strchr(line,'\r')) != NULL)
|
||||
{
|
||||
*s = '\0';
|
||||
}
|
||||
/*
|
||||
* Skip comments (#) and empty lines.
|
||||
*/
|
||||
s = & line[0];
|
||||
if ((*s) != '#' && (*s) != '\0')
|
||||
{
|
||||
/* Extract the NtXXX name */
|
||||
name = (char *)strtok(s," \t");
|
||||
/* Extract the ZwXXX name */
|
||||
name2 = (char *)strtok(NULL," \t");
|
||||
//value = strtok(NULL," \t");
|
||||
/* Extract the stack size */
|
||||
nr_args = (char *)strtok(NULL," \t");
|
||||
/*
|
||||
* Remove, if present, the trailing LF.
|
||||
*/
|
||||
if ((stmp = strchr(nr_args, '\n')) != NULL)
|
||||
{
|
||||
*stmp = '\0';
|
||||
}
|
||||
#ifdef VERBOSE
|
||||
printf("%3d \"%s\"\n",sys_call_idx,name);
|
||||
#endif
|
||||
/*
|
||||
* Write the NTDLL stub for the current
|
||||
* system call: NtXXX and ZwXXX symbols
|
||||
* are aliases.
|
||||
*/
|
||||
write_syscall_stub(out, out3, name, name2,
|
||||
nr_args, sys_call_idx);
|
||||
}
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
void usage(char * argv0)
|
||||
{
|
||||
printf("Usage: %s sysfuncs.lst napi.c napi.h zw.c\n"
|
||||
" sysfuncs.lst system functions database\n"
|
||||
" napi.c NTDLL stubs\n"
|
||||
" napi.h NTOSKRNL service table\n"
|
||||
" zw.c NTOSKRNL Zw stubs\n",
|
||||
argv0
|
||||
);
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
FILE * in; /* System calls database */
|
||||
FILE * out1; /* NTDLL stubs */
|
||||
FILE * out2; /* SERVICE_TABLE */
|
||||
FILE * out3; /* NTOSKRNL Zw stubs */
|
||||
int ret;
|
||||
|
||||
if (argc != 5)
|
||||
{
|
||||
usage(argv[0]);
|
||||
return(1);
|
||||
}
|
||||
|
||||
in = fopen(argv[1],"rb");
|
||||
if (in == NULL)
|
||||
{
|
||||
perror("Failed to open input file (system calls database)");
|
||||
return(1);
|
||||
}
|
||||
|
||||
out1 = fopen(argv[2],"wb");
|
||||
if (out1 == NULL)
|
||||
{
|
||||
perror("Failed to open output file (NTDLL stubs)");
|
||||
return(1);
|
||||
}
|
||||
|
||||
out2 = fopen(argv[3],"wb");
|
||||
if (out2 == NULL)
|
||||
{
|
||||
perror("Failed to open output file (NTOSKRNL service table)");
|
||||
return(1);
|
||||
}
|
||||
|
||||
out3 = fopen(argv[4],"wb");
|
||||
if (out3 == NULL)
|
||||
{
|
||||
perror("Failed to open output file (NTOSKRNL Zw stubs)");
|
||||
return(1);
|
||||
}
|
||||
|
||||
ret = process(in,out1,out2,out3);
|
||||
rewind(in);
|
||||
ret = makeSystemServiceTable(in, out2);
|
||||
|
||||
fclose(in);
|
||||
fclose(out1);
|
||||
fclose(out2);
|
||||
fclose(out3);
|
||||
|
||||
return(ret);
|
||||
}
|
22
msvc6/iface/native/makefile
Normal file
22
msvc6/iface/native/makefile
Normal file
@@ -0,0 +1,22 @@
|
||||
# $Id: makefile,v 1.1 2004/02/06 08:21:56 fireball Exp $
|
||||
#
|
||||
# ReactOS Operating System - MSVC6 Zw functions stubs to call generator
|
||||
#
|
||||
|
||||
SYSTEM_CALLS_DB = ..\..\..\reactos\iface\native\sysfuncs.lst
|
||||
KERNEL_ZW_CALLS =..\..\ntoskrnl\nt_zw_msvc.c
|
||||
|
||||
all: genntdll.exe $(KERNEL_ZW_CALLS)
|
||||
|
||||
$(KERNEL_ZW_CALLS) : $(SYSTEM_CALLS_DB)
|
||||
genntdll.exe $(SYSTEM_CALLS_DB) foo1 foo2 $(KERNEL_ZW_CALLS)
|
||||
-@del foo1
|
||||
-@del foo2
|
||||
|
||||
genntdll.exe : genntdll.c
|
||||
|
||||
clean:
|
||||
-@del *.exe
|
||||
-@del *.obj
|
||||
-@del $(KERNEL_ZW_CALLS)
|
||||
|
4
msvc6/ntoskrnl/.cvsignore
Normal file
4
msvc6/ntoskrnl/.cvsignore
Normal file
@@ -0,0 +1,4 @@
|
||||
Debug
|
||||
Release
|
||||
nt_zw_msvc.c
|
||||
ntoskrnl.def
|
167
msvc6/ntoskrnl/ke_i386_bthread.c
Normal file
167
msvc6/ntoskrnl/ke_i386_bthread.c
Normal file
@@ -0,0 +1,167 @@
|
||||
/*
|
||||
* ReactOS kernel
|
||||
* Copyright (C) 2000 David Welch <welch@cwcom.net>
|
||||
*
|
||||
* Moved to MSVC-compatible inline assembler by Mike Nordell, 2003-12-25
|
||||
*
|
||||
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: ke_i386_bthread.c,v 1.1 2004/02/06 08:21:56 fireball Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: ntoskrnl/ke/i386/bthread.S
|
||||
* PURPOSE: Trap handlers
|
||||
* PROGRAMMER: David Welch (david.welch@seh.ox.ac.uk)
|
||||
*/
|
||||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <ddk/status.h>
|
||||
#include <internal/i386/segment.h>
|
||||
#include <internal/i386/fpu.h>
|
||||
#include <internal/ps.h>
|
||||
#include <ddk/defines.h>
|
||||
|
||||
/* Values for contextflags */
|
||||
#define CONTEXT_i386 0x10000
|
||||
#ifndef CONTEXT_CONTROL
|
||||
#define CONTEXT_CONTROL (CONTEXT_i386 | 1)
|
||||
#endif
|
||||
#ifndef CONTEXT_INTEGER
|
||||
#define CONTEXT_INTEGER (CONTEXT_i386 | 2)
|
||||
#endif
|
||||
#ifndef CONTEXT_SEGMENTS
|
||||
#define CONTEXT_SEGMENTS (CONTEXT_i386 | 4)
|
||||
#endif
|
||||
#ifndef CONTEXT_FLOATING_POINT
|
||||
#define CONTEXT_FLOATING_POINT (CONTEXT_i386 | 8)
|
||||
#endif
|
||||
#ifndef CONTEXT_DEBUG_REGISTERS
|
||||
#define CONTEXT_DEBUG_REGISTERS (CONTEXT_i386 | 0x10)
|
||||
#endif
|
||||
#ifndef CONTEXT_FULL
|
||||
#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS)
|
||||
#endif
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
void KeReturnFromSystemCallWithHook();
|
||||
|
||||
VOID PiBeforeBeginThread(CONTEXT c);
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
|
||||
__declspec(naked)
|
||||
VOID PsBeginThread(PKSTART_ROUTINE StartRoutine, PVOID StartContext)
|
||||
{
|
||||
/*
|
||||
* This isn't really a function, we are called as the return address
|
||||
* of the context switch function
|
||||
*/
|
||||
|
||||
/*
|
||||
* Do the necessary prolog after a context switch
|
||||
*/
|
||||
__asm
|
||||
{
|
||||
call PiBeforeBeginThread
|
||||
|
||||
/*
|
||||
* Call the actual start of the thread
|
||||
*/
|
||||
// We must NOT use the arguments by name. VC then uses EBP-relative
|
||||
// addressing, and with an EBP of 0 you can imagine what happens.
|
||||
mov ebx, 4[esp] // StartRoutine
|
||||
mov eax, 8[esp] // StartContext
|
||||
push eax
|
||||
call ebx /* Call the start routine */
|
||||
add esp, 4
|
||||
|
||||
/*
|
||||
* Terminate the thread
|
||||
*/
|
||||
push eax
|
||||
call PsTerminateSystemThread
|
||||
add esp, 4
|
||||
|
||||
}
|
||||
|
||||
/* If that fails then bug check */
|
||||
KeBugCheck(0);
|
||||
|
||||
/* And if that fails then loop */
|
||||
for (;;)
|
||||
; // forever
|
||||
}
|
||||
|
||||
|
||||
__declspec(naked)
|
||||
VOID PsBeginThreadWithContextInternal(VOID)
|
||||
{
|
||||
/*
|
||||
* This isn't really a function, we are called as the return
|
||||
* address of a context switch
|
||||
*/
|
||||
|
||||
/*
|
||||
* Do the necessary prolog before the context switch
|
||||
*/
|
||||
__asm
|
||||
{
|
||||
call PiBeforeBeginThread
|
||||
|
||||
/*
|
||||
* Load the context flags.
|
||||
*/
|
||||
pop ebx
|
||||
|
||||
/*
|
||||
* Load the debugging registers
|
||||
*/
|
||||
test ebx, (CONTEXT_DEBUG_REGISTERS & ~CONTEXT_i386)
|
||||
jz L1
|
||||
pop eax __asm mov dr0, eax
|
||||
pop eax __asm mov dr1, eax
|
||||
pop eax __asm mov dr2, eax
|
||||
pop eax __asm mov dr3, eax
|
||||
pop eax __asm mov dr6, eax
|
||||
pop eax __asm mov dr7, eax
|
||||
jmp L3
|
||||
L1:
|
||||
add esp, 24
|
||||
L3:
|
||||
|
||||
/*
|
||||
* Load the floating point registers
|
||||
*/
|
||||
mov eax, HardwareMathSupport
|
||||
test eax,eax
|
||||
jz L2
|
||||
test ebx, (CONTEXT_FLOATING_POINT & ~CONTEXT_i386)
|
||||
jz L2
|
||||
frstor [esp]
|
||||
L2:
|
||||
add esp, 112
|
||||
|
||||
/* Load the rest of the thread's user mode context. */
|
||||
mov eax, 0
|
||||
jmp KeReturnFromSystemCallWithHook
|
||||
}
|
||||
}
|
||||
|
114
msvc6/ntoskrnl/ke_i386_irqhand.c
Normal file
114
msvc6/ntoskrnl/ke_i386_irqhand.c
Normal file
@@ -0,0 +1,114 @@
|
||||
/*
|
||||
* ReactOS kernel
|
||||
* Copyright (C) 2000 David Welch <welch@cwcom.net>
|
||||
*
|
||||
* Moved to MSVC-compatible inline assembler by Mike Nordell, 2003-12-26
|
||||
*
|
||||
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/*
|
||||
* FILE: ntoskrnl/ke/i386/vm86_sup.S
|
||||
* PURPOSE: V86 mode support
|
||||
* PROGRAMMER: David Welch (welch@cwcom.net)
|
||||
* UPDATE HISTORY:
|
||||
* Created 09/10/00
|
||||
*/
|
||||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#pragma hdrstop
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <ddk/status.h>
|
||||
#include <internal/i386/segment.h>
|
||||
#include <internal/i386/fpu.h>
|
||||
#include <internal/ps.h>
|
||||
#include <ddk/defines.h>
|
||||
#include <internal/v86m.h>
|
||||
#include <ntos/tss.h>
|
||||
#include <internal/trap.h>
|
||||
#include <internal/ps.h>
|
||||
|
||||
#include <roscfg.h>
|
||||
#include <internal/ntoskrnl.h>
|
||||
#include <internal/i386/segment.h>
|
||||
|
||||
// no arg-list, but asm doesn't care anyway
|
||||
void KiInterruptDispatch();
|
||||
|
||||
|
||||
#define DEFINE_INT_HANDLER(N) \
|
||||
__declspec(naked) \
|
||||
void irq_handler_##N() \
|
||||
{ \
|
||||
__asm pushad \
|
||||
__asm push ds \
|
||||
__asm push es \
|
||||
__asm push fs \
|
||||
__asm mov eax, 0xceafbeef \
|
||||
__asm push eax \
|
||||
__asm mov ax, KERNEL_DS \
|
||||
__asm mov ds, ax \
|
||||
__asm mov es, ax \
|
||||
__asm mov ax, PCR_SELECTOR \
|
||||
__asm mov fs, ax \
|
||||
__asm push esp \
|
||||
__asm push N \
|
||||
__asm call KiInterruptDispatch \
|
||||
__asm pop eax \
|
||||
__asm pop eax \
|
||||
__asm pop eax \
|
||||
__asm pop fs \
|
||||
__asm pop es \
|
||||
__asm pop ds \
|
||||
__asm popad \
|
||||
__asm iretd
|
||||
// NOTE: The inline assembler can't deal with having the final brace,
|
||||
// ending the function, on the same line as an __asm, why there is
|
||||
// none here and it MUST be added when using the macro!
|
||||
|
||||
DEFINE_INT_HANDLER(0)
|
||||
}
|
||||
DEFINE_INT_HANDLER(1)
|
||||
}
|
||||
DEFINE_INT_HANDLER(2)
|
||||
}
|
||||
DEFINE_INT_HANDLER(3)
|
||||
}
|
||||
DEFINE_INT_HANDLER(4)
|
||||
}
|
||||
DEFINE_INT_HANDLER(5)
|
||||
}
|
||||
DEFINE_INT_HANDLER(6)
|
||||
}
|
||||
DEFINE_INT_HANDLER(7)
|
||||
}
|
||||
DEFINE_INT_HANDLER(8)
|
||||
}
|
||||
DEFINE_INT_HANDLER(9)
|
||||
}
|
||||
DEFINE_INT_HANDLER(10)
|
||||
}
|
||||
DEFINE_INT_HANDLER(11)
|
||||
}
|
||||
DEFINE_INT_HANDLER(12)
|
||||
}
|
||||
DEFINE_INT_HANDLER(13)
|
||||
}
|
||||
DEFINE_INT_HANDLER(14)
|
||||
}
|
||||
DEFINE_INT_HANDLER(15)
|
||||
}
|
||||
|
655
msvc6/ntoskrnl/ke_i386_multiboot.c
Normal file
655
msvc6/ntoskrnl/ke_i386_multiboot.c
Normal file
@@ -0,0 +1,655 @@
|
||||
/*
|
||||
* ReactOS kernel
|
||||
* Copyright (C) 2003 Mike Nordell
|
||||
* Based on multiboot.S (no copyright note present), but so heavily
|
||||
* modified that it bears close to no resemblance to the original work.
|
||||
*
|
||||
* MSVC compatible combination of plain C and inline assembler to:
|
||||
* 1 Relocated all the sections in the kernel - something I feel the
|
||||
* bootloader should have done, but multiboot being just a "raw image"
|
||||
* loader, it unfortunately had to be done here - in-place.
|
||||
* 2 Set up page directories and stuff.
|
||||
* 3 Load IDT, GDT and turn on paging, making us execute at the intended
|
||||
* target address (as if the image was PE-loaded and parsed into that addr.)
|
||||
* 4 Call _main, and let the rest of the startup run...
|
||||
*
|
||||
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
//
|
||||
// TODO: Fix the MP parts
|
||||
//
|
||||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#pragma hdrstop
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <ddk/status.h>
|
||||
#include <internal/i386/segment.h>
|
||||
#include <internal/i386/fpu.h>
|
||||
#include <internal/ps.h>
|
||||
#include <ddk/defines.h>
|
||||
#include <pe.h>
|
||||
|
||||
#include <roscfg.h>
|
||||
#include <internal/ntoskrnl.h>
|
||||
#include <internal/i386/segment.h>
|
||||
#include <internal/ps.h>
|
||||
#include <internal/ldr.h>
|
||||
|
||||
|
||||
// some notes:
|
||||
// The MSVC linker (by defult) emits no special .bss section, but uses the data
|
||||
// section with a rawsize smaller than virtualsize. The "slack" is BSS.
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// Some macros we need
|
||||
|
||||
// some stuff straight from freeloaders multiboot.h
|
||||
#define MULTIBOOT_HEADER_MAGIC (0x1BADB002)
|
||||
#define MULTIBOOT_HEADER_FLAGS (0x00010003)
|
||||
|
||||
#define TARGET_LOAD_ADDR 0x00200000
|
||||
#define BASE_TO_PHYS_DIST (KERNEL_BASE - TARGET_LOAD_ADDR)
|
||||
|
||||
#define V2P(x) (x - BASE_TO_PHYS_DIST)
|
||||
|
||||
|
||||
#ifdef MP
|
||||
|
||||
#define AP_MAGIC (0x12481020)
|
||||
|
||||
#endif /* MP */
|
||||
|
||||
|
||||
|
||||
void initialize_page_directory(void);
|
||||
|
||||
void* relocate_pointer_log_to_phys(const void* p)
|
||||
{
|
||||
// DON'T CALL this function until relocation of .data and/or .rdata,
|
||||
// is completed - but still be sure that we have not yet enabled paging!
|
||||
return (void*)((DWORD)p - BASE_TO_PHYS_DIST);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
// Macro to emit one character to Bochs debug-port (0x9e).
|
||||
// We need to do it this way, since at this point of the startup, obviously
|
||||
// we have neither HAL nor DbgPrint support.
|
||||
#define BOCHS_OUT_CHAR(c1) __asm push eax __asm push edx __asm mov dx, 0xe9 __asm mov al, c1 __asm out dx, al __asm pop edx __asm pop eax
|
||||
|
||||
void boch_out_hex_digit(unsigned char ch1)
|
||||
{
|
||||
if (ch1 <= 9) { ch1 += '0'; } else { ch1 += 'a' - 10; }
|
||||
BOCHS_OUT_CHAR(ch1)
|
||||
}
|
||||
|
||||
void bochs_dump_hex(DWORD p)
|
||||
{
|
||||
unsigned char ch3 = (unsigned char)((p >> 28) & 0x0f);
|
||||
unsigned char cl3 = (unsigned char)((p >> 24) & 0x0f);
|
||||
unsigned char ch2 = (unsigned char)((p >> 20) & 0x0f);
|
||||
unsigned char cl2 = (unsigned char)((p >> 16) & 0x0f);
|
||||
unsigned char ch1 = (unsigned char)((p >> 12) & 0x0f);
|
||||
unsigned char cl1 = (unsigned char)((p >> 8) & 0x0f);
|
||||
unsigned char ch0 = (unsigned char)((p >> 4) & 0x0f);
|
||||
unsigned char cl0 = (unsigned char)((p >> 0) & 0x0f);
|
||||
BOCHS_OUT_CHAR('0') BOCHS_OUT_CHAR('x')
|
||||
boch_out_hex_digit(ch3);
|
||||
boch_out_hex_digit(cl3);
|
||||
boch_out_hex_digit(ch2);
|
||||
boch_out_hex_digit(cl2);
|
||||
boch_out_hex_digit(ch1);
|
||||
boch_out_hex_digit(cl1);
|
||||
boch_out_hex_digit(ch0);
|
||||
boch_out_hex_digit(cl0);
|
||||
BOCHS_OUT_CHAR('\n')
|
||||
}
|
||||
|
||||
static void bochs_out_string(const char* s /* logical address! */)
|
||||
{
|
||||
s = relocate_pointer_log_to_phys(s);
|
||||
__asm
|
||||
{
|
||||
pushad
|
||||
mov dx, 0xe9
|
||||
mov ebx, s
|
||||
L1:
|
||||
cmp byte ptr[ebx], 0
|
||||
je end
|
||||
mov al, [ebx]
|
||||
out dx, al
|
||||
inc ebx
|
||||
jmp L1
|
||||
end:
|
||||
popad
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#define BOCHS_OUT_CHAR(c1)
|
||||
#define bochs_dump_hex(VAL)
|
||||
#define bochs_out_string(STR)
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
typedef char kernel_page_t[4096];
|
||||
|
||||
// Use 4096 (pagesize) more bytes that actually needed for each *_holder,
|
||||
// to be able to make sure that the other stuff is page aligned.
|
||||
// No other way to do this portably... :-(
|
||||
//
|
||||
// TODO: Consider allocating just one large block of BSS memory here, align
|
||||
// just the first pointer, and then get the other ones just as offsets from
|
||||
// this (now-aligned) pointer. That way we could get away with wasting just
|
||||
// one page of memory, instead of 4 (like 16KB would matter... but still)
|
||||
static kernel_page_t* startup_pagedirectory_holder[1024 * 2];
|
||||
static kernel_page_t* lowmem_pagetable_holder[1024 * 2];
|
||||
static kernel_page_t* kernel_pagetable_holder[32*1024 + 1];
|
||||
static __int32 kpcr_pagetable_holder[4096/4 * 2];
|
||||
|
||||
#ifdef MP
|
||||
char apic_pagetable[4096];
|
||||
#endif /* MP */
|
||||
|
||||
__int32 unmap_me[4096/4];
|
||||
__int32 unmap_me2[4096/4];
|
||||
__int32 unmap_me3[4096/4];
|
||||
|
||||
__int32 init_stack[3*4096/4];
|
||||
int init_stack_top;
|
||||
|
||||
|
||||
__int32 trap_stack[3*4096/4];
|
||||
int trap_stack_top;
|
||||
|
||||
|
||||
|
||||
void _main();
|
||||
// lie a bit about types - since C is basically typeless anyway, it
|
||||
// doesn't really matter what type we say it is here...
|
||||
extern int KiGdtDescriptor;
|
||||
extern int KiIdtDescriptor;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* This is called by the realmode loader, with protected mode
|
||||
* enabled, paging disabled and the segment registers pointing
|
||||
* a 4Gb, 32-bit segment starting at zero.
|
||||
*
|
||||
* EAX = Multiboot magic or application processor magic
|
||||
*
|
||||
* EBX = Points to a structure in lowmem with data from the
|
||||
* loader
|
||||
*/
|
||||
#pragma intrinsic(memset)
|
||||
|
||||
|
||||
// We need to implement this ourself, to be able to get to it by short call's
|
||||
void our_memmove(void* pDest, const void* pSrc, DWORD size)
|
||||
{
|
||||
char* pD = (char*)pDest;
|
||||
const char* pS = (char*)pSrc;
|
||||
if (pDest < pSrc)
|
||||
{
|
||||
while (size--)
|
||||
{
|
||||
*pD++ = *pS++;
|
||||
}
|
||||
}
|
||||
else if (pSrc < pDest)
|
||||
{
|
||||
while (size--)
|
||||
{
|
||||
pD[size] = pS[size];
|
||||
}
|
||||
}
|
||||
}
|
||||
void dummy_placeholder(void)
|
||||
{
|
||||
// NOTE: This function MUST be placed JUST AFTER MultibootStub in memory.
|
||||
// Yes, it's BEFORE it in this file, but linkorder.txt fixes this for us.
|
||||
}
|
||||
|
||||
|
||||
// This one is needed, since the boot loader hasn't relocated us
|
||||
__declspec(naked)
|
||||
void MultibootStub()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
jmp _multiboot_entry
|
||||
// This sucks, I know...
|
||||
#define EMIT_DWORD(x) __asm __emit ((x) >> 0) & 0xff __asm _emit ((x) >> 8) & 0xff __asm _emit ((x) >> 16) & 0xff __asm _emit ((x) >> 24) & 0xff
|
||||
ALIGN 4
|
||||
EMIT_DWORD(MULTIBOOT_HEADER_MAGIC)
|
||||
EMIT_DWORD(MULTIBOOT_HEADER_FLAGS)
|
||||
EMIT_DWORD(-(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS))
|
||||
EMIT_DWORD(TARGET_LOAD_ADDR + 0x0400 + 0x04)
|
||||
// Now just make something up, since there is no way we can know, beforehand,
|
||||
// where any BSS data is...
|
||||
EMIT_DWORD((TARGET_LOAD_ADDR))
|
||||
EMIT_DWORD((TARGET_LOAD_ADDR + 1*1024*1024)) /* assume ntoskrnel.exe is < 1MB! */
|
||||
EMIT_DWORD((TARGET_LOAD_ADDR + 2*1024*1024)) /* just to have something, let's say BSS is 1MB too */
|
||||
/* This is *REALLY* ugly! If MultibootStub is *EVER* at */
|
||||
/* any other offset, this will crash like crazy! */
|
||||
/* 0x0400 is the file alignment of the binary (ntoskrnl.exe) */
|
||||
EMIT_DWORD((TARGET_LOAD_ADDR + 0x0400)) // entry_addr
|
||||
|
||||
_multiboot_entry:
|
||||
|
||||
cld // just for good measure
|
||||
}
|
||||
|
||||
{
|
||||
/* Save the multiboot or application processor magic */
|
||||
DWORD saved_eax;
|
||||
DWORD saved_ebx;
|
||||
__asm mov saved_eax, eax
|
||||
__asm mov saved_ebx, ebx
|
||||
|
||||
// bochs_out_string("MultibootStub()\n");
|
||||
|
||||
// OK, time to relocate the brute-loaded image in-place...
|
||||
// If we don't watch it, we will overwrite ourselves here - imagine
|
||||
// the fireworks! :-) That's why the function dummy_placeholder()
|
||||
// MUST be placed JUST JUST AFTER this function.
|
||||
|
||||
{
|
||||
PIMAGE_NT_HEADERS NtHeader = RtlImageNtHeader((PVOID)TARGET_LOAD_ADDR);
|
||||
PIMAGE_SECTION_HEADER Section = IMAGE_FIRST_SECTION(NtHeader);
|
||||
const int count = NtHeader->FileHeader.NumberOfSections;
|
||||
int i;
|
||||
Section += count - 1; // make it point to the last section
|
||||
// NOTE: We MUST walk the sections "backwards".
|
||||
for (i = count-1; i >= 0; --i, --Section)
|
||||
{
|
||||
DWORD dwSrc = TARGET_LOAD_ADDR + Section->PointerToRawData;
|
||||
DWORD dwDst = TARGET_LOAD_ADDR + Section->VirtualAddress;
|
||||
DWORD dwSiz = Section->SizeOfRawData;
|
||||
const char* pEndThisFunc;
|
||||
|
||||
if (dwSrc == dwDst)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
//bochs_out_string("MultibootStub: relocating section\n");
|
||||
|
||||
if (Section->Characteristics & IMAGE_SCN_MEM_EXECUTE)
|
||||
{
|
||||
// can't get a pointer to a label from plain C :-(
|
||||
__asm mov pEndThisFunc, offset dummy_placeholder
|
||||
pEndThisFunc -= BASE_TO_PHYS_DIST;
|
||||
if (dwDst < (DWORD)pEndThisFunc)
|
||||
{
|
||||
// We must not move the code from under our feet!
|
||||
// This can only happen in the code segment - the first segment
|
||||
DWORD diff = (DWORD)pEndThisFunc - dwDst;
|
||||
dwDst += diff;
|
||||
dwSrc += diff;
|
||||
dwSiz -= diff;
|
||||
}
|
||||
}
|
||||
|
||||
// obviously we must use memmove, since memory can overlap
|
||||
our_memmove((void*)dwDst, (void*)dwSrc, dwSiz);
|
||||
|
||||
// While at it, we might as well zero any uninitialized data in the section...
|
||||
if (Section->SizeOfRawData < Section->Misc.VirtualSize)
|
||||
{
|
||||
memset((char*)(Section->VirtualAddress + Section->SizeOfRawData + TARGET_LOAD_ADDR),
|
||||
0,
|
||||
Section->Misc.VirtualSize - Section->SizeOfRawData);
|
||||
}
|
||||
}
|
||||
|
||||
// Now all sections are relocated to their intended in-memory layout,
|
||||
// but we are still running int the low TARGET_LOAD_ADDR memory.
|
||||
|
||||
{
|
||||
// Time to jump to the real startup, the entry-point function.
|
||||
// We must do this using assembler, since both eax and ebx are assumed
|
||||
// to hold some magic values.
|
||||
typedef VOID (STDCALL* pfn_t)(PPEB);
|
||||
pfn_t pfn = (pfn_t)(NtHeader->OptionalHeader.AddressOfEntryPoint + TARGET_LOAD_ADDR);
|
||||
#if 1
|
||||
__asm mov eax, saved_eax
|
||||
__asm mov ebx, saved_ebx
|
||||
__asm mov ecx, pfn
|
||||
__asm jmp ecx
|
||||
#else
|
||||
__asm mov ebx, saved_ebx
|
||||
(*pfn)((PPEB)saved_eax);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// TMN: TODO: Convert this to the extent possible to plain C code
|
||||
// Due to the "magic" above, we enter this function with all kernel sections
|
||||
// properly relocated wrt. offsets from start-of-mem. But, we are still running
|
||||
// without paging, meaning that the address that is to be KERNEL_BASE+xyz is
|
||||
// currently still TARGET_LOAD_ADDR+xyz.
|
||||
// We get aways with a few of the functions call here since they are near calls
|
||||
// (PC-relative), but don't even _think_ about calling any other functions
|
||||
// until we have turned on paging!
|
||||
VOID STDCALL
|
||||
NtProcessStartup(
|
||||
IN PPEB Peb
|
||||
)
|
||||
{
|
||||
DWORD saved_ebx;
|
||||
DWORD saved_eax;
|
||||
__asm mov saved_ebx, ebx
|
||||
__asm mov saved_eax, eax
|
||||
|
||||
bochs_out_string("NtProcessStartup: Just entered\n");
|
||||
|
||||
#ifdef MP
|
||||
if (saved_eax != AP_MAGIC)
|
||||
{
|
||||
#endif /* MP */
|
||||
|
||||
bochs_out_string("NtProcessStartup: Calling initialize_page_directory()\n");
|
||||
|
||||
initialize_page_directory(); // Initialize the page directory
|
||||
|
||||
bochs_out_string("NtProcessStartup: Page directory initialized\n");
|
||||
|
||||
#ifdef MP
|
||||
|
||||
__asm
|
||||
{
|
||||
/*
|
||||
* Initialize the page table that maps the APIC register address space
|
||||
*/
|
||||
|
||||
/*
|
||||
* FIXME: APIC register address space can be non-standard so do the
|
||||
* mapping later
|
||||
*/
|
||||
mov esi, V2P(apic_pagetable)
|
||||
mov edi, 0
|
||||
mov eax, 0xFEC0001B
|
||||
mov [esi+edi], eax
|
||||
mov edi, 0x800
|
||||
mov eax, 0xFEE0001B
|
||||
mov [esi+edi], eax
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* MP */
|
||||
|
||||
{
|
||||
bochs_out_string("NtProcessStartup: Enabling paging...\n");
|
||||
|
||||
/*
|
||||
* Enable paging and set write protect
|
||||
* bit 31: PG, bit 16: WP
|
||||
*/
|
||||
__asm mov eax, cr0
|
||||
__asm or eax, 0x80010000
|
||||
__asm mov cr0, eax
|
||||
|
||||
bochs_out_string("NtProcessStartup: Paging enabled!\n");
|
||||
bochs_out_string("NtProcessStartup: But we're still at the \"low\" address\n");
|
||||
|
||||
/*
|
||||
* Do an absolute jump because we now want to execute above KERNEL_BASE
|
||||
*/
|
||||
__asm mov eax, offset l2_
|
||||
__asm jmp eax
|
||||
}
|
||||
|
||||
l2_:
|
||||
|
||||
bochs_out_string("We have now left \"low\" memory, and is flying at an altitude of...\n");
|
||||
bochs_out_string("OK, we're not flying, we're just executing above KERNEL_BASE\n");
|
||||
|
||||
/*
|
||||
* Load the GDTR and IDTR with new tables located above
|
||||
* KERNEL_BASE
|
||||
*/
|
||||
|
||||
#ifdef _DEBUG
|
||||
{
|
||||
DWORD val = (DWORD)&KiGdtDescriptor;
|
||||
bochs_out_string("&KiGdtDescriptor: ");
|
||||
bochs_dump_hex(val);
|
||||
|
||||
val = (DWORD)&KiIdtDescriptor;
|
||||
bochs_out_string("&KiIdtDescriptor: ");
|
||||
bochs_dump_hex(val);
|
||||
}
|
||||
#endif
|
||||
|
||||
bochs_out_string("Loading GDT and IDT...\n");
|
||||
|
||||
/* FIXME: Application processors should have their own GDT/IDT */
|
||||
__asm lgdt KiGdtDescriptor
|
||||
__asm lidt KiIdtDescriptor
|
||||
|
||||
bochs_out_string("GDT and IDT loaded\n");
|
||||
|
||||
__asm
|
||||
{
|
||||
/*
|
||||
* Reload the data segment registers
|
||||
*/
|
||||
mov eax, KERNEL_DS
|
||||
mov ds, ax
|
||||
mov es, ax
|
||||
mov gs, ax
|
||||
mov ss, ax
|
||||
mov eax, 0
|
||||
mov fs, ax
|
||||
}
|
||||
|
||||
bochs_out_string("NtProcessStartup: segment registers loaded\n");
|
||||
|
||||
#ifdef MP
|
||||
|
||||
if (saved_eax == AP_MAGIC)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
/*
|
||||
* This is an application processor executing
|
||||
*/
|
||||
|
||||
/*
|
||||
* Initialize EFLAGS
|
||||
*/
|
||||
push 0
|
||||
popfd
|
||||
|
||||
/*
|
||||
* Call the application processor initialization code
|
||||
*/
|
||||
push 0
|
||||
push offset l7_
|
||||
push KERNEL_CS
|
||||
push KiSystemStartup
|
||||
retf
|
||||
|
||||
/*
|
||||
* Catch illegal returns from KiSystemStartup
|
||||
*/
|
||||
l7_:
|
||||
pop eax
|
||||
}
|
||||
|
||||
KeBugCheck(0);
|
||||
|
||||
for (;;)
|
||||
; /*forever */
|
||||
}
|
||||
|
||||
#endif /* MP */
|
||||
|
||||
bochs_out_string("Loading fs with PCR_SELECTOR\n");
|
||||
|
||||
/* Load the PCR selector */
|
||||
__asm mov eax, PCR_SELECTOR
|
||||
__asm mov fs, ax
|
||||
|
||||
bochs_out_string("Loading esp with init_stack_top : "); bochs_dump_hex((DWORD)&init_stack_top);
|
||||
bochs_out_string("Just for interest, init_stack is at: "); bochs_dump_hex((DWORD)init_stack);
|
||||
bochs_out_string("Meaing the init_stack in bytes is : "); bochs_dump_hex((DWORD)&init_stack_top - (DWORD)init_stack);
|
||||
|
||||
|
||||
/* Load the initial kernel stack */
|
||||
__asm mov esp, offset init_stack_top
|
||||
|
||||
bochs_out_string("Loaded esp with init_stack_top\n");
|
||||
|
||||
/*
|
||||
* Initialize EFLAGS
|
||||
*/
|
||||
__asm push 0
|
||||
__asm popfd
|
||||
|
||||
bochs_out_string("Loaded eflags\n");
|
||||
|
||||
/*
|
||||
* Call the main kernel initialization
|
||||
*/
|
||||
bochs_out_string("TMN: Calling _main...\n");
|
||||
|
||||
__asm
|
||||
{
|
||||
xor ebp,ebp
|
||||
push ebx
|
||||
push edx
|
||||
push offset l5_
|
||||
push KERNEL_CS
|
||||
push offset _main
|
||||
retf
|
||||
|
||||
/*
|
||||
* Catch illegal returns from main, try bug checking the system,
|
||||
* if that fails then loop forever.
|
||||
*/
|
||||
l5_:
|
||||
pop eax
|
||||
pop eax
|
||||
|
||||
} // end of __asm block
|
||||
|
||||
bochs_out_string("TMN: Back from _main ?! Let's crash!\n");
|
||||
|
||||
KeBugCheck(0);
|
||||
|
||||
for (;;)
|
||||
; /*forever */
|
||||
}
|
||||
|
||||
|
||||
void initialize_page_directory(void)
|
||||
{
|
||||
/*
|
||||
* Initialize the page directory
|
||||
*/
|
||||
|
||||
// First convert the pointers from the virtual address the compiler generated
|
||||
// code thinks we are at, to the currently active physical address we actually
|
||||
// got loaded into by the loader. At this point we have been relocated, so
|
||||
// that there is a 1:1 mapping between KERNEL_BASE+n and TARGET_LOAD_ADDR+n.
|
||||
|
||||
kernel_page_t** startup_pagedirectory = startup_pagedirectory_holder;
|
||||
kernel_page_t** lowmem_pagetable = lowmem_pagetable_holder;
|
||||
kernel_page_t** kernel_pagetable = kernel_pagetable_holder;
|
||||
__int32* kpcr_pagetable = kpcr_pagetable_holder;
|
||||
|
||||
bochs_out_string("startup_pagedirectory before reloc: ");
|
||||
bochs_dump_hex((DWORD)startup_pagedirectory);
|
||||
|
||||
startup_pagedirectory = (kernel_page_t**)relocate_pointer_log_to_phys(startup_pagedirectory);
|
||||
lowmem_pagetable = (kernel_page_t**)relocate_pointer_log_to_phys(lowmem_pagetable);
|
||||
kernel_pagetable = (kernel_page_t**)relocate_pointer_log_to_phys(kernel_pagetable);
|
||||
kpcr_pagetable = (__int32*) relocate_pointer_log_to_phys(kpcr_pagetable);
|
||||
|
||||
bochs_out_string("startup_pagedirectory after reloc : ");
|
||||
bochs_dump_hex((DWORD)startup_pagedirectory);
|
||||
|
||||
// Now align the pointers to PAGE_SIZE...
|
||||
startup_pagedirectory = (kernel_page_t**)(((ULONG_PTR)startup_pagedirectory + 4095) & ~4095);
|
||||
lowmem_pagetable = (kernel_page_t**)(((ULONG_PTR)lowmem_pagetable + 4095) & ~4095);
|
||||
kernel_pagetable = (kernel_page_t**)(((ULONG_PTR)kernel_pagetable + 4095) & ~4095);
|
||||
kpcr_pagetable = (__int32* ) (((ULONG_PTR)kpcr_pagetable + 4095) & ~4095);
|
||||
|
||||
#ifdef _DEBUG
|
||||
bochs_out_string("startup_pagedirectory aligned : ");
|
||||
bochs_dump_hex((DWORD)startup_pagedirectory);
|
||||
#endif
|
||||
|
||||
// Ugly macros, I know...
|
||||
#define DEST(PAGE) startup_pagedirectory[(PAGE) + 0xc00 / 4]
|
||||
#define SRC(PAGE) (kernel_page_t*)((char*)kernel_pagetable + (PAGE)*4096 + 0x7)
|
||||
|
||||
startup_pagedirectory[0] = (kernel_page_t*)((char*)lowmem_pagetable + 0x7);
|
||||
|
||||
{
|
||||
unsigned int i;
|
||||
for (i=0; i<32; ++i)
|
||||
{
|
||||
DEST(i) = SRC(i);
|
||||
}
|
||||
}
|
||||
|
||||
DEST( 64) = (kernel_page_t*)((char*)lowmem_pagetable + 0x7);
|
||||
DEST(192) = (kernel_page_t*)((char*)startup_pagedirectory + 0x7);
|
||||
#ifdef MP
|
||||
DEST(251) = (kernel_page_t*)((char*)apic_pagetable + 0x7);
|
||||
#endif /* MP */
|
||||
DEST(252) = (kernel_page_t*)((char*)kpcr_pagetable + 0x7);
|
||||
|
||||
|
||||
{
|
||||
unsigned int i;
|
||||
/* Initialize the page table that maps low memory */
|
||||
for (i=0; i<1024; ++i) {
|
||||
lowmem_pagetable[i] = (kernel_page_t*)(i*4096 + 7);
|
||||
}
|
||||
|
||||
/* Initialize the page table that maps kernel memory */
|
||||
for (i=0; i<6144/4 /* 1536 pages = 6MB */; ++i) {
|
||||
kernel_pagetable[i] = (kernel_page_t*)(i*4096 + TARGET_LOAD_ADDR + 0x7);
|
||||
}
|
||||
|
||||
/* Initialize the page table that maps the initial KPCR (at FF000000) */
|
||||
kpcr_pagetable[0] = 0x1007;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set up the PDBR
|
||||
*/
|
||||
__asm mov eax, startup_pagedirectory
|
||||
__asm mov cr3, eax
|
||||
}
|
||||
|
110
msvc6/ntoskrnl/ke_i386_stkswitch.c
Normal file
110
msvc6/ntoskrnl/ke_i386_stkswitch.c
Normal file
@@ -0,0 +1,110 @@
|
||||
/*
|
||||
* ReactOS kernel
|
||||
* Copyright (C) 2000 David Welch <welch@cwcom.net>
|
||||
*
|
||||
* Moved to MSVC-compatible inline assembler by Mike Nordell, 2003-12-26
|
||||
*
|
||||
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/*
|
||||
* FILE: ntoskrnl/ke/i386/vm86_sup.S
|
||||
* PURPOSE: V86 mode support
|
||||
* PROGRAMMER: David Welch (welch@cwcom.net)
|
||||
* UPDATE HISTORY:
|
||||
* Created 09/10/00
|
||||
*/
|
||||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#pragma hdrstop
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <ddk/status.h>
|
||||
#include <internal/i386/segment.h>
|
||||
#include <internal/i386/fpu.h>
|
||||
#include <internal/ps.h>
|
||||
#include <ddk/defines.h>
|
||||
#include <internal/v86m.h>
|
||||
#include <ntos/tss.h>
|
||||
//#include <ntos/service.h>
|
||||
#include <internal/trap.h>
|
||||
#include <internal/ps.h>
|
||||
|
||||
#include <roscfg.h>
|
||||
#include <internal/ntoskrnl.h>
|
||||
#include <internal/i386/segment.h>
|
||||
|
||||
|
||||
void KeReturnFromSystemCall();
|
||||
|
||||
/*
|
||||
* FUNCTION: KeStackSwitchAndRet
|
||||
* PURPOSE: Switch to a new stack and return from the first frame on
|
||||
* the new stack which was assumed to a stdcall function with
|
||||
* 8 bytes of arguments and which saved edi, esi and ebx.
|
||||
*/
|
||||
__declspec(naked)
|
||||
VOID STDCALL
|
||||
KeStackSwitchAndRet(PVOID NewStack)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
|
||||
cli
|
||||
|
||||
mov esp, NewStack
|
||||
|
||||
sti
|
||||
|
||||
pop edi
|
||||
pop esi
|
||||
pop ebx
|
||||
|
||||
pop ebp
|
||||
ret 8
|
||||
}
|
||||
}
|
||||
|
||||
__declspec(naked)
|
||||
VOID STDCALL
|
||||
KePushAndStackSwitchAndSysRet(ULONG Push, PVOID NewStack)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
|
||||
push ebx
|
||||
push esi
|
||||
push edi
|
||||
|
||||
cli
|
||||
|
||||
push 8[ebp]
|
||||
|
||||
mov ebx, fs:KPCR_CURRENT_THREAD
|
||||
mov KTHREAD_CALLBACK_STACK[ebx], esp
|
||||
mov esp, 12[ebp]
|
||||
|
||||
sti
|
||||
|
||||
push 0
|
||||
call KeLowerIrql
|
||||
|
||||
jmp KeReturnFromSystemCall
|
||||
}
|
||||
}
|
325
msvc6/ntoskrnl/ke_i386_syscall.c
Normal file
325
msvc6/ntoskrnl/ke_i386_syscall.c
Normal file
@@ -0,0 +1,325 @@
|
||||
/*
|
||||
* ReactOS kernel
|
||||
* Copyright (C) 2000 David Welch <welch@cwcom.net>
|
||||
*
|
||||
* Converted to MSVC-compatible inline assembler by Mike Nordell, 2003.
|
||||
*
|
||||
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/*
|
||||
* FILE: MSVC6/ntoskrnl/ke_i386_syscall.c
|
||||
* based on ntoskrnl/ke/i386/syscall.s
|
||||
* PURPOSE: syscall dispatching and support
|
||||
* PROGRAMMER: David Welch (welch@cwcom.net)
|
||||
* UPDATE HISTORY:
|
||||
* Created 09/10/00
|
||||
*/
|
||||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#pragma hdrstop
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <ddk/status.h>
|
||||
#include <internal/i386/segment.h>
|
||||
#include <internal/i386/fpu.h>
|
||||
#include <internal/ps.h>
|
||||
#include <ddk/defines.h>
|
||||
#include <internal/v86m.h>
|
||||
#include <ntos/tss.h>
|
||||
//#include <ntos/service.h>
|
||||
#include <internal/trap.h>
|
||||
#include <internal/ps.h>
|
||||
|
||||
#include <roscfg.h>
|
||||
#include <internal/ntoskrnl.h>
|
||||
#include <internal/i386/segment.h>
|
||||
|
||||
|
||||
#define KernelMode (0)
|
||||
#define UserMode (1)
|
||||
|
||||
|
||||
// TMN: Replicated here to reduce mess-time
|
||||
#ifdef STATUS_INVALID_SYSTEM_SERVICE
|
||||
#undef STATUS_INVALID_SYSTEM_SERVICE
|
||||
#endif
|
||||
#define STATUS_INVALID_SYSTEM_SERVICE 0xc000001c
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
|
||||
void KiServiceCheck (ULONG Nr);
|
||||
ULONG KiAfterSystemCallHook(ULONG NtStatus, PKTRAP_FRAME TrapFrame);
|
||||
VOID KiSystemCallHook(ULONG Nr, ...);
|
||||
|
||||
void KeReturnFromSystemCallWithHook();
|
||||
void KeReturnFromSystemCall();
|
||||
|
||||
|
||||
__declspec(naked)
|
||||
void interrupt_handler2e(void)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
/* Construct a trap frame on the stack */
|
||||
|
||||
/* Error code */
|
||||
push 0
|
||||
push ebp
|
||||
push ebx
|
||||
push esi
|
||||
push edi
|
||||
push fs
|
||||
/* Load PCR selector into fs */
|
||||
mov ebx, PCR_SELECTOR
|
||||
mov fs, bx
|
||||
|
||||
/* Save the old exception list */
|
||||
mov ebx, fs:KPCR_EXCEPTION_LIST
|
||||
push ebx
|
||||
/* Set the exception handler chain terminator */
|
||||
mov dword ptr fs:KPCR_EXCEPTION_LIST, 0xffffffff
|
||||
/* Get a pointer to the current thread */
|
||||
mov esi, fs:KPCR_CURRENT_THREAD
|
||||
/* Save the old previous mode */
|
||||
xor ebx,ebx
|
||||
mov bl, ss:KTHREAD_PREVIOUS_MODE[esi]
|
||||
push ebx
|
||||
/* Set the new previous mode based on the saved CS selector */
|
||||
mov ebx, 0x24[esp]
|
||||
and ebx, 0x0000FFFF
|
||||
cmp ebx, KERNEL_CS
|
||||
#if 0
|
||||
// TODO: Verify implementation change and use this code path
|
||||
// to remove two conditional jumps.
|
||||
setnz bl
|
||||
mov ss:KTHREAD_PREVIOUS_MODE[esi], bl
|
||||
#else
|
||||
jne L1
|
||||
mov ss:KTHREAD_PREVIOUS_MODE[esi], KernelMode
|
||||
jmp L3
|
||||
L1:
|
||||
mov ss:KTHREAD_PREVIOUS_MODE[esi], UserMode
|
||||
L3:
|
||||
|
||||
#endif
|
||||
/* Save other registers */
|
||||
push eax
|
||||
push ecx
|
||||
push edx
|
||||
push ds
|
||||
push es
|
||||
push gs
|
||||
push 0 /* DR7 */
|
||||
push 0 /* DR6 */
|
||||
push 0 /* DR3 */
|
||||
push 0 /* DR2 */
|
||||
push 0 /* DR1 */
|
||||
push 0 /* DR0 */
|
||||
push 0 /* XXX: TempESP */
|
||||
push 0 /* XXX: TempCS */
|
||||
push 0 /* XXX: DebugPointer */
|
||||
push 0 /* XXX: DebugArgMark */
|
||||
mov ebx, 0x60[esp]
|
||||
push ebx /* DebugEIP */
|
||||
push ebp /* DebugEBP */
|
||||
|
||||
/* Load the segment registers */
|
||||
mov bx, KERNEL_DS
|
||||
mov ds, bx
|
||||
mov es, bx
|
||||
mov gs, bx
|
||||
|
||||
/*
|
||||
* Save the old trap frame pointer over where we would save the EDX
|
||||
* register.
|
||||
*/
|
||||
mov ebx, KTHREAD_TRAP_FRAME[esi]
|
||||
mov 0x3C[esp], ebx
|
||||
|
||||
/* Save a pointer to the trap frame in the TCB */
|
||||
mov KTHREAD_TRAP_FRAME[esi], esp
|
||||
|
||||
/* Set ES to kernel segment */
|
||||
mov bx, KERNEL_DS
|
||||
mov es, bx
|
||||
|
||||
/* Allocate new Kernel stack frame */
|
||||
mov ebp, esp
|
||||
|
||||
/* Users's current stack frame pointer is source */
|
||||
mov esi, edx
|
||||
|
||||
/* Determine system service table to use */
|
||||
cmp eax, 0x0fff
|
||||
ja new_useShadowTable
|
||||
|
||||
/* Check to see if EAX is valid/inrange */
|
||||
cmp eax, es:KeServiceDescriptorTable + 8
|
||||
jbe new_serviceInRange
|
||||
mov eax, STATUS_INVALID_SYSTEM_SERVICE
|
||||
jmp KeReturnFromSystemCall
|
||||
|
||||
new_serviceInRange:
|
||||
|
||||
/* Allocate room for argument list from kernel stack */
|
||||
mov ecx, es:KeServiceDescriptorTable + 12
|
||||
mov ecx, es:[ecx + eax * 4]
|
||||
sub esp, ecx
|
||||
|
||||
/* Copy the arguments from the user stack to the kernel stack */
|
||||
mov edi, esp
|
||||
cld
|
||||
repe movsb
|
||||
|
||||
/* DS is now also kernel segment */
|
||||
mov ds, bx
|
||||
|
||||
/* Call system call hook */
|
||||
push eax
|
||||
call KiSystemCallHook
|
||||
pop eax
|
||||
|
||||
/* Make the system service call */
|
||||
mov ecx, es:KeServiceDescriptorTable
|
||||
mov eax, es:[ecx + eax * 4]
|
||||
call eax
|
||||
|
||||
#if CHECKED
|
||||
/* Bump Service Counter */
|
||||
#endif
|
||||
|
||||
/* Deallocate the kernel stack frame */
|
||||
mov esp, ebp
|
||||
|
||||
/* Call the post system call hook and deliver any pending APCs */
|
||||
push ebp
|
||||
push eax
|
||||
call KiAfterSystemCallHook
|
||||
add esp, 8
|
||||
|
||||
jmp KeReturnFromSystemCall
|
||||
|
||||
new_useShadowTable:
|
||||
|
||||
sub eax, 0x1000
|
||||
|
||||
/* Check to see if EAX is valid/inrange */
|
||||
cmp eax, es:KeServiceDescriptorTableShadow + 24
|
||||
jbe new_shadowServiceInRange
|
||||
mov eax, STATUS_INVALID_SYSTEM_SERVICE
|
||||
jmp KeReturnFromSystemCall
|
||||
|
||||
new_shadowServiceInRange:
|
||||
|
||||
/* Allocate room for argument list from kernel stack */
|
||||
mov ecx, es:KeServiceDescriptorTableShadow + 28
|
||||
mov ecx, es:[ecx + eax * 4]
|
||||
sub esp, ecx
|
||||
|
||||
/* Copy the arguments from the user stack to the kernel stack */
|
||||
mov edi, esp
|
||||
cld
|
||||
repe movsb
|
||||
|
||||
/* DS is now also kernel segment */
|
||||
mov ds, bx
|
||||
|
||||
/* Call system call hook */
|
||||
// pushl %eax
|
||||
// call _KiSystemCallHook
|
||||
// popl %eax
|
||||
|
||||
/* Call service check routine */
|
||||
push eax
|
||||
call KiServiceCheck
|
||||
pop eax
|
||||
|
||||
/* Make the system service call */
|
||||
mov ecx, es:KeServiceDescriptorTableShadow + 16
|
||||
mov eax, es:[ecx + eax * 4]
|
||||
call eax
|
||||
|
||||
#if CHECKED
|
||||
/* Bump Service Counter */
|
||||
#endif
|
||||
|
||||
/* Deallocate the kernel stack frame */
|
||||
mov esp, ebp
|
||||
|
||||
// TMN: Added, to be able to separate this into different functions
|
||||
jmp KeReturnFromSystemCallWithHook
|
||||
}
|
||||
}
|
||||
|
||||
__declspec(naked)
|
||||
void KeReturnFromSystemCallWithHook()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
/* Call the post system call hook and deliver any pending APCs */
|
||||
push esp
|
||||
push eax
|
||||
call KiAfterSystemCallHook
|
||||
add esp, 8
|
||||
|
||||
// TMN: Added, to be able to separate this into different functions
|
||||
jmp KeReturnFromSystemCall
|
||||
}
|
||||
}
|
||||
|
||||
__declspec(naked)
|
||||
void KeReturnFromSystemCall()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
/* Restore the user context */
|
||||
/* Get a pointer to the current thread */
|
||||
mov esi, fs:0x124
|
||||
|
||||
/* Restore the old trap frame pointer */
|
||||
mov ebx, 0x3c[esp]
|
||||
mov KTHREAD_TRAP_FRAME[esi], ebx
|
||||
|
||||
/* Skip debug information and unsaved registers */
|
||||
add esp, 0x30
|
||||
pop gs
|
||||
pop es
|
||||
pop ds
|
||||
pop edx
|
||||
pop ecx
|
||||
add esp, 4 /* Don't restore eax */
|
||||
|
||||
/* Restore the old previous mode */
|
||||
pop ebx
|
||||
mov ss:KTHREAD_PREVIOUS_MODE[esi], bl
|
||||
|
||||
/* Restore the old exception handler list */
|
||||
pop ebx
|
||||
mov fs:KPCR_EXCEPTION_LIST, ebx
|
||||
|
||||
pop fs
|
||||
pop edi
|
||||
pop esi
|
||||
pop ebx
|
||||
pop ebp
|
||||
add esp, 4 /* Ignore error code */
|
||||
|
||||
iretd
|
||||
}
|
||||
}
|
468
msvc6/ntoskrnl/ke_i386_trap.c
Normal file
468
msvc6/ntoskrnl/ke_i386_trap.c
Normal file
@@ -0,0 +1,468 @@
|
||||
/*
|
||||
* ReactOS kernel
|
||||
* Copyright (C) 2000 David Welch <welch@cwcom.net>
|
||||
*
|
||||
* Moved to MSVC-compatible inline assembler by Mike Nordell, 2003-12-26
|
||||
*
|
||||
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/*
|
||||
* FILE: ntoskrnl/ke/i386/vm86_sup.S
|
||||
* PURPOSE: V86 mode support
|
||||
* PROGRAMMER: David Welch (welch@cwcom.net)
|
||||
* UPDATE HISTORY:
|
||||
* Created 09/10/00
|
||||
*/
|
||||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#pragma hdrstop
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <ddk/status.h>
|
||||
#include <internal/i386/segment.h>
|
||||
#include <internal/i386/fpu.h>
|
||||
#include <internal/ps.h>
|
||||
#include <ddk/defines.h>
|
||||
#include <internal/v86m.h>
|
||||
#include <ntos/tss.h>
|
||||
#include <internal/trap.h>
|
||||
#include <internal/ps.h>
|
||||
|
||||
#include <roscfg.h>
|
||||
#include <internal/ntoskrnl.h>
|
||||
#include <internal/i386/segment.h>
|
||||
|
||||
|
||||
void KiV86Complete(void);
|
||||
void KiTrapHandler(void);
|
||||
void KiDoubleFaultHandler(void);
|
||||
|
||||
extern int KiPcrInitDone;
|
||||
|
||||
/*
|
||||
* Epilog for exception handlers
|
||||
*/
|
||||
__declspec(naked)
|
||||
void KiTrapEpilog()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
cmp eax, 1 /* Check for v86 recovery */
|
||||
jne _KiTrapRet
|
||||
jmp KiV86Complete
|
||||
_KiTrapRet:
|
||||
/* Skip debug information and unsaved registers */
|
||||
add esp, 0x30
|
||||
pop gs
|
||||
pop es
|
||||
pop ds
|
||||
pop edx
|
||||
pop ecx
|
||||
pop eax
|
||||
|
||||
/* Restore the old previous mode */
|
||||
pop ebx
|
||||
mov ss:KTHREAD_PREVIOUS_MODE[esi], bl
|
||||
|
||||
/* Restore the old exception handler list */
|
||||
pop ebx
|
||||
mov fs:KPCR_EXCEPTION_LIST, ebx
|
||||
|
||||
pop fs
|
||||
pop edi
|
||||
pop esi
|
||||
pop ebx
|
||||
pop ebp
|
||||
add esp, 4 /* Ignore error code */
|
||||
|
||||
iretd
|
||||
}
|
||||
}
|
||||
|
||||
__declspec(naked)
|
||||
void KiTrapProlog()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push edi
|
||||
push fs
|
||||
|
||||
/*
|
||||
* Check that the PCR exists, very early in the boot process it may
|
||||
* not
|
||||
*/
|
||||
cmp ss:KiPcrInitDone, 0
|
||||
je L5_
|
||||
|
||||
/* Load the PCR selector into fs */
|
||||
mov ebx, PCR_SELECTOR
|
||||
mov fs, bx
|
||||
|
||||
/* Save the old exception list */
|
||||
mov ebx, fs:KPCR_EXCEPTION_LIST
|
||||
push ebx
|
||||
|
||||
/* Put the exception handler chain terminator */
|
||||
mov dword ptr fs:KPCR_EXCEPTION_LIST, 0xffffffff
|
||||
|
||||
/* Get a pointer to the current thread */
|
||||
mov edi, fs:KPCR_CURRENT_THREAD
|
||||
|
||||
/* The current thread may be NULL early in the boot process */
|
||||
cmp edi, 0
|
||||
je L4_
|
||||
|
||||
/* Save the old previous mode */
|
||||
xor ebx, ebx
|
||||
mov bl, ss:KTHREAD_PREVIOUS_MODE[edi]
|
||||
push ebx
|
||||
|
||||
/* Set the new previous mode based on the saved CS selector */
|
||||
mov ebx, 0x24[esp]
|
||||
and ebx, 0x0000FFFF
|
||||
cmp ebx, KERNEL_CS
|
||||
jne L1_
|
||||
mov ss:KTHREAD_PREVIOUS_MODE[edi], KernelMode
|
||||
jmp L3_
|
||||
L1_:
|
||||
mov ss:KTHREAD_PREVIOUS_MODE[edi], UserMode
|
||||
L3_:
|
||||
|
||||
/* Save other registers */
|
||||
push eax
|
||||
push ecx
|
||||
push edx
|
||||
push ds
|
||||
push es
|
||||
push gs
|
||||
push 0 /* DR7 */
|
||||
push 0 /* DR6 */
|
||||
push 0 /* DR3 */
|
||||
push 0 /* DR2 */
|
||||
push 0 /* DR1 */
|
||||
push 0 /* DR0 */
|
||||
push 0 /* XXX: TempESP */
|
||||
push 0 /* XXX: TempCS */
|
||||
push 0 /* XXX: DebugPointer */
|
||||
push 0 /* XXX: DebugArgMark */
|
||||
mov ebx, 0x60[esp]
|
||||
push ebx /* XXX: DebugEIP */
|
||||
push ebp /* XXX: DebugEBP */
|
||||
|
||||
/* Load the segment registers */
|
||||
mov ebx, KERNEL_DS
|
||||
mov ds, bx
|
||||
mov es, bx
|
||||
mov gs, bx
|
||||
|
||||
/* Set ES to kernel segment */
|
||||
mov bx, KERNEL_DS
|
||||
mov es, bx
|
||||
|
||||
mov ebx, esp
|
||||
mov ebp, esp
|
||||
|
||||
/* Save the old trap frame. */
|
||||
cmp edi, 0
|
||||
je L7_
|
||||
mov edx, ss:KTHREAD_TRAP_FRAME[edi]
|
||||
push edx
|
||||
jmp L8_
|
||||
L7_:
|
||||
push 0
|
||||
L8_:
|
||||
|
||||
/* Save a pointer to the trap frame in the current KTHREAD */
|
||||
cmp edi, 0
|
||||
je L6_
|
||||
mov ss:KTHREAD_TRAP_FRAME[edi], ebx
|
||||
L6_:
|
||||
|
||||
/* Call the C exception handler */
|
||||
push esi
|
||||
push ebx
|
||||
call KiTrapHandler
|
||||
add esp, 8
|
||||
|
||||
/* Get a pointer to the current thread */
|
||||
mov esi, fs:KPCR_CURRENT_THREAD
|
||||
|
||||
/* Restore the old trap frame pointer */
|
||||
pop ebx
|
||||
mov KTHREAD_TRAP_FRAME[esi], ebx
|
||||
|
||||
/* Return to the caller */
|
||||
jmp KiTrapEpilog
|
||||
|
||||
/* Handle the no-pcr case out of line */
|
||||
L5_:
|
||||
push 0
|
||||
|
||||
/* Handle the no-thread case out of line */
|
||||
L4_:
|
||||
push 0
|
||||
jmp L3_
|
||||
|
||||
} // end of __asm block
|
||||
}
|
||||
|
||||
|
||||
__declspec(naked)
|
||||
void KiTrap0()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
/* No error code */
|
||||
push 0
|
||||
push ebp
|
||||
push ebx
|
||||
push esi
|
||||
mov esi, 0
|
||||
jmp KiTrapProlog
|
||||
}
|
||||
}
|
||||
|
||||
__declspec(naked)
|
||||
void KiTrap1()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
/* No error code */
|
||||
push 0
|
||||
push ebp
|
||||
push ebx
|
||||
push esi
|
||||
mov esi, 1
|
||||
jmp KiTrapProlog
|
||||
}
|
||||
}
|
||||
|
||||
__declspec(naked)
|
||||
void KiTrap2()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push 0
|
||||
push ebp
|
||||
push ebx
|
||||
push esi
|
||||
mov esi, 2
|
||||
jmp KiTrapProlog
|
||||
}
|
||||
}
|
||||
|
||||
__declspec(naked)
|
||||
void KiTrap3()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push 0
|
||||
push ebp
|
||||
push ebx
|
||||
push esi
|
||||
mov esi, 3
|
||||
jmp KiTrapProlog
|
||||
}
|
||||
}
|
||||
|
||||
__declspec(naked)
|
||||
void KiTrap4()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push 0
|
||||
push ebp
|
||||
push ebx
|
||||
push esi
|
||||
mov esi, 4
|
||||
jmp KiTrapProlog
|
||||
}
|
||||
}
|
||||
|
||||
__declspec(naked)
|
||||
void KiTrap5()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push 0
|
||||
push ebp
|
||||
push ebx
|
||||
push esi
|
||||
mov esi, 5
|
||||
jmp KiTrapProlog
|
||||
}
|
||||
}
|
||||
|
||||
__declspec(naked)
|
||||
void KiTrap6()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push 0
|
||||
push ebp
|
||||
push ebx
|
||||
push esi
|
||||
mov esi, 6
|
||||
jmp KiTrapProlog
|
||||
}
|
||||
}
|
||||
|
||||
__declspec(naked)
|
||||
void KiTrap7()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push 0
|
||||
push ebp
|
||||
push ebx
|
||||
push esi
|
||||
mov esi, 7
|
||||
jmp KiTrapProlog
|
||||
}
|
||||
}
|
||||
|
||||
__declspec(naked)
|
||||
void KiTrap8()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
call KiDoubleFaultHandler
|
||||
iretd
|
||||
}
|
||||
}
|
||||
|
||||
__declspec(naked)
|
||||
void KiTrap9()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push 0
|
||||
push ebp
|
||||
push ebx
|
||||
push esi
|
||||
mov esi, 9
|
||||
jmp KiTrapProlog
|
||||
}
|
||||
}
|
||||
|
||||
__declspec(naked)
|
||||
void KiTrap10()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push ebp
|
||||
push ebx
|
||||
push esi
|
||||
mov esi, 10
|
||||
jmp KiTrapProlog
|
||||
}
|
||||
}
|
||||
|
||||
__declspec(naked)
|
||||
void KiTrap11()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push ebp
|
||||
push ebx
|
||||
push esi
|
||||
mov esi, 11
|
||||
jmp KiTrapProlog
|
||||
}
|
||||
}
|
||||
|
||||
__declspec(naked)
|
||||
void KiTrap12()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push ebp
|
||||
push ebx
|
||||
push esi
|
||||
mov esi, 12
|
||||
jmp KiTrapProlog
|
||||
}
|
||||
}
|
||||
|
||||
__declspec(naked)
|
||||
void KiTrap13()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push ebp
|
||||
push ebx
|
||||
push esi
|
||||
mov esi, 13
|
||||
jmp KiTrapProlog
|
||||
}
|
||||
}
|
||||
|
||||
__declspec(naked)
|
||||
void KiTrap14()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push ebp
|
||||
push ebx
|
||||
push esi
|
||||
mov esi, 14
|
||||
jmp KiTrapProlog
|
||||
}
|
||||
}
|
||||
|
||||
__declspec(naked)
|
||||
void KiTrap15()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push 0
|
||||
push ebp
|
||||
push ebx
|
||||
push esi
|
||||
mov esi, 15
|
||||
jmp KiTrapProlog
|
||||
}
|
||||
}
|
||||
|
||||
__declspec(naked)
|
||||
void KiTrap16()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push 0
|
||||
push ebp
|
||||
push ebx
|
||||
push esi
|
||||
mov esi, 16
|
||||
jmp KiTrapProlog
|
||||
}
|
||||
}
|
||||
|
||||
__declspec(naked)
|
||||
void KiTrapUnknown()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push 0
|
||||
push ebp
|
||||
push ebx
|
||||
push esi
|
||||
mov esi, 255
|
||||
jmp KiTrapProlog
|
||||
}
|
||||
}
|
||||
|
||||
/* EOF */
|
217
msvc6/ntoskrnl/ke_i386_tskswitch.c
Normal file
217
msvc6/ntoskrnl/ke_i386_tskswitch.c
Normal file
@@ -0,0 +1,217 @@
|
||||
/*
|
||||
* ReactOS kernel
|
||||
* Copyright (C) 2000 David Welch <welch@cwcom.net>
|
||||
*
|
||||
* Moved to MSVC-compatible inline assembler by Mike Nordell, 2003-12-26
|
||||
*
|
||||
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/*
|
||||
* FILE: ntoskrnl/ke/i386/vm86_sup.S
|
||||
* PURPOSE: V86 mode support
|
||||
* PROGRAMMER: David Welch (welch@cwcom.net)
|
||||
* UPDATE HISTORY:
|
||||
* Created 09/10/00
|
||||
*/
|
||||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#pragma hdrstop
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <ddk/status.h>
|
||||
#include <internal/i386/segment.h>
|
||||
#include <internal/i386/fpu.h>
|
||||
#include <internal/ps.h>
|
||||
#include <ddk/defines.h>
|
||||
#include <internal/v86m.h>
|
||||
#include <ntos/tss.h>
|
||||
//#include <ntos/service.h>
|
||||
#include <internal/trap.h>
|
||||
#include <internal/ps.h>
|
||||
|
||||
#include <roscfg.h>
|
||||
#include <internal/ntoskrnl.h>
|
||||
#include <internal/i386/segment.h>
|
||||
|
||||
|
||||
extern KSPIN_LOCK PiThreadListLock;
|
||||
extern ULONG PiNrThreadsAwaitingReaping;
|
||||
extern ULONG MmGlobalKernelPageDirectory[1024];
|
||||
|
||||
VOID STDCALL PiWakeupReaperThread(VOID);
|
||||
VOID KeSetBaseGdtSelector(ULONG Entry, PVOID Base);
|
||||
|
||||
|
||||
/*
|
||||
* FUNCTIONS: Switches to another thread's context
|
||||
* ARGUMENTS:
|
||||
* Thread = Thread to switch to
|
||||
* OldThread = Thread to switch from
|
||||
*/
|
||||
__declspec(naked)
|
||||
VOID
|
||||
Ki386ContextSwitch(struct _KTHREAD* NewThread, struct _KTHREAD* OldThread)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
|
||||
/* Save callee save registers. */
|
||||
push ebx
|
||||
push esi
|
||||
push edi
|
||||
|
||||
cli /* This is a critical section for this processor. */
|
||||
|
||||
/* Get the pointer to the new thread. */
|
||||
mov ebx, NewThread
|
||||
|
||||
/*
|
||||
* Set the base of the TEB selector to the base of the TEB for
|
||||
* this thread.
|
||||
*/
|
||||
push ebx
|
||||
push KTHREAD_TEB[ebx]
|
||||
push TEB_SELECTOR
|
||||
call KeSetBaseGdtSelector
|
||||
add esp, 8
|
||||
pop ebx
|
||||
|
||||
/*
|
||||
* Load the PCR selector.
|
||||
*/
|
||||
mov eax, PCR_SELECTOR
|
||||
mov fs, ax
|
||||
|
||||
/*
|
||||
* Set the current thread information in the PCR.
|
||||
*/
|
||||
mov fs:KPCR_CURRENT_THREAD, ebx
|
||||
|
||||
/*
|
||||
* Set the current LDT
|
||||
*/
|
||||
xor eax, eax
|
||||
mov edi, ETHREAD_THREADS_PROCESS[ebx]
|
||||
test word ptr KPROCESS_LDT_DESCRIPTOR0[edi], 0xFFFF
|
||||
jz L4
|
||||
|
||||
push KPROCESS_LDT_DESCRIPTOR1[edi]
|
||||
push KPROCESS_LDT_DESCRIPTOR0[edi]
|
||||
push LDT_SELECTOR
|
||||
call KeSetGdtSelector
|
||||
add esp, 12
|
||||
|
||||
mov eax, LDT_SELECTOR
|
||||
|
||||
L4:
|
||||
lldt ax
|
||||
|
||||
/*
|
||||
* Load up the iomap offset for this thread in
|
||||
* preparation for setting it below.
|
||||
*/
|
||||
mov eax, KPROCESS_IOPM_OFFSET[edi]
|
||||
|
||||
/*
|
||||
* FIXME: Save debugging state.
|
||||
*/
|
||||
|
||||
/*
|
||||
* FIXME: Save floating point state.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Switch stacks
|
||||
*/
|
||||
mov ebx, 12[ebp]
|
||||
mov KTHREAD_KERNEL_STACK[ebx], esp
|
||||
mov ebx, 8[ebp]
|
||||
mov esp, KTHREAD_KERNEL_STACK[ebx]
|
||||
mov edi, KTHREAD_STACK_LIMIT[ebx]
|
||||
|
||||
/*
|
||||
* Set the stack pointer in this processors TSS
|
||||
*/
|
||||
mov esi, fs:KPCR_TSS
|
||||
|
||||
/*
|
||||
* Set current IOPM offset in the TSS
|
||||
*/
|
||||
mov KTSS_IOMAPBASE[esi], ax
|
||||
|
||||
mov eax, KTHREAD_INITIAL_STACK[ebx]
|
||||
mov KTSS_ESP0[esi], eax
|
||||
|
||||
/*
|
||||
* Change the address space
|
||||
*/
|
||||
mov ebx, ETHREAD_THREADS_PROCESS[ebx]
|
||||
mov eax, KPROCESS_DIRECTORY_TABLE_BASE[ebx]
|
||||
mov cr3, eax
|
||||
|
||||
/*
|
||||
* Set up the PDE for the top of the new stack.
|
||||
*/
|
||||
mov ebx, 0
|
||||
L2:
|
||||
mov esi, edi
|
||||
shr esi, 22
|
||||
mov eax, 0xF03C0000[esi*4]
|
||||
cmp eax, 0
|
||||
jne L1
|
||||
mov eax, MmGlobalKernelPageDirectory[esi*4]
|
||||
mov 0xF03C0000[esi*4], eax
|
||||
L1:
|
||||
add edi, 4096
|
||||
inc ebx
|
||||
cmp ebx, (MM_STACK_SIZE / 4096)
|
||||
jl L2
|
||||
|
||||
/*
|
||||
* FIXME: Restore floating point state
|
||||
*/
|
||||
|
||||
/*
|
||||
* FIXME: Restore debugging state
|
||||
*/
|
||||
|
||||
/*
|
||||
* Exit the critical section
|
||||
*/
|
||||
sti
|
||||
}
|
||||
|
||||
KeReleaseSpinLockFromDpcLevel(&PiThreadListLock);
|
||||
|
||||
if (PiNrThreadsAwaitingReaping) {
|
||||
PiWakeupReaperThread();
|
||||
}
|
||||
|
||||
__asm
|
||||
{
|
||||
/*
|
||||
* Restore the saved register and exit
|
||||
*/
|
||||
pop edi
|
||||
pop esi
|
||||
pop ebx
|
||||
|
||||
pop ebp
|
||||
ret
|
||||
}
|
||||
}
|
256
msvc6/ntoskrnl/ke_i386_v86m_sup.c
Normal file
256
msvc6/ntoskrnl/ke_i386_v86m_sup.c
Normal file
@@ -0,0 +1,256 @@
|
||||
/*
|
||||
* ReactOS kernel
|
||||
* Copyright (C) 2000 David Welch <welch@cwcom.net>
|
||||
*
|
||||
* Moved to MSVC-compatible inline assembler by Mike Nordell, 2003-12-25
|
||||
*
|
||||
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/*
|
||||
* FILE: ntoskrnl/ke/i386/vm86_sup.S
|
||||
* PURPOSE: V86 mode support
|
||||
* PROGRAMMER: David Welch (welch@cwcom.net)
|
||||
* UPDATE HISTORY:
|
||||
* Created 09/10/00
|
||||
*/
|
||||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#pragma hdrstop
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <ddk/status.h>
|
||||
#include <internal/i386/segment.h>
|
||||
#include <internal/i386/fpu.h>
|
||||
#include <internal/ps.h>
|
||||
#include <ddk/defines.h>
|
||||
#include <internal/v86m.h>
|
||||
#include <ntos/tss.h>
|
||||
#include <internal/trap.h>
|
||||
#include <internal/ps.h>
|
||||
|
||||
#include <roscfg.h>
|
||||
#include <internal/ntoskrnl.h>
|
||||
#include <internal/i386/segment.h>
|
||||
#include <internal/ps.h>
|
||||
|
||||
|
||||
// Taken from ntoskrnl/include/internal/v86m.h, since that one must be fixed
|
||||
// a bit before it could be used from here.
|
||||
#define KV86M_REGISTERS_EBP (0x0)
|
||||
#define KV86M_REGISTERS_EDI (0x4)
|
||||
#define KV86M_REGISTERS_ESI (0x8)
|
||||
#define KV86M_REGISTERS_EDX (0xC)
|
||||
#define KV86M_REGISTERS_ECX (0x10)
|
||||
#define KV86M_REGISTERS_EBX (0x14)
|
||||
#define KV86M_REGISTERS_EAX (0x18)
|
||||
#define KV86M_REGISTERS_DS (0x1C)
|
||||
#define KV86M_REGISTERS_ES (0x20)
|
||||
#define KV86M_REGISTERS_FS (0x24)
|
||||
#define KV86M_REGISTERS_GS (0x28)
|
||||
#define KV86M_REGISTERS_EIP (0x2C)
|
||||
#define KV86M_REGISTERS_CS (0x30)
|
||||
#define KV86M_REGISTERS_EFLAGS (0x34)
|
||||
#define KV86M_REGISTERS_ESP (0x38)
|
||||
#define KV86M_REGISTERS_SS (0x3C)
|
||||
|
||||
|
||||
void KiV86Complete();
|
||||
|
||||
|
||||
/*
|
||||
* Starts in v86 mode with the registers set to the
|
||||
* specified values.
|
||||
*/
|
||||
|
||||
__declspec(naked)
|
||||
VOID Ki386RetToV86Mode(KV86M_REGISTERS* InRegs,
|
||||
KV86M_REGISTERS* OutRegs)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
/*
|
||||
* Setup a stack frame
|
||||
*/
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
|
||||
pushad /* Save registers */
|
||||
|
||||
mov ebx, InRegs
|
||||
|
||||
/*
|
||||
* Save ebp
|
||||
*/
|
||||
push ebp
|
||||
|
||||
/*
|
||||
* Save a pointer to IN_REGS which the v86m exception handler will
|
||||
* use to handle exceptions
|
||||
*/
|
||||
push ebx
|
||||
|
||||
/*
|
||||
* Since we are going to fiddle with the stack pointer this must be
|
||||
* a critical section for this processor
|
||||
*/
|
||||
|
||||
/*
|
||||
* Save the old initial stack
|
||||
*/
|
||||
mov esi, fs:KPCR_CURRENT_THREAD
|
||||
mov edi, KTHREAD_INITIAL_STACK[esi]
|
||||
push edi
|
||||
|
||||
/*
|
||||
* We also need to set the stack in the kthread structure
|
||||
*/
|
||||
mov KTHREAD_INITIAL_STACK[esi], esp
|
||||
|
||||
/*
|
||||
* The stack used for handling exceptions from v86 mode in this thread
|
||||
* will be the current stack adjusted so we don't overwrite the
|
||||
* existing stack frames
|
||||
*/
|
||||
mov esi, fs:KPCR_TSS
|
||||
mov KTSS_ESP0[esi], esp
|
||||
|
||||
/*
|
||||
* Create the stack frame for an iret to v86 mode
|
||||
*/
|
||||
push KV86M_REGISTERS_GS[ebx]
|
||||
push KV86M_REGISTERS_FS[ebx]
|
||||
push KV86M_REGISTERS_DS[ebx]
|
||||
push KV86M_REGISTERS_ES[ebx]
|
||||
push KV86M_REGISTERS_SS[ebx]
|
||||
push KV86M_REGISTERS_ESP[ebx]
|
||||
push KV86M_REGISTERS_EFLAGS[ebx]
|
||||
push KV86M_REGISTERS_CS[ebx]
|
||||
push KV86M_REGISTERS_EIP[ebx]
|
||||
|
||||
/*
|
||||
* Setup the CPU registers
|
||||
*/
|
||||
mov eax, KV86M_REGISTERS_EAX[ebx]
|
||||
mov ecx, KV86M_REGISTERS_ECX[ebx]
|
||||
mov edx, KV86M_REGISTERS_EDX[ebx]
|
||||
mov esi, KV86M_REGISTERS_ESI[ebx]
|
||||
mov edi, KV86M_REGISTERS_EDI[ebx]
|
||||
mov ebp, KV86M_REGISTERS_EBP[ebx]
|
||||
mov ebx, KV86M_REGISTERS_EBX[ebx]
|
||||
|
||||
/*
|
||||
* Go to v86 mode
|
||||
*/
|
||||
iretd
|
||||
|
||||
/*
|
||||
* Handle the completion of a vm86 routine. We are called from
|
||||
* an exception handler with the registers at the point of the
|
||||
* exception on the stack.
|
||||
*/
|
||||
|
||||
jmp KiV86Complete // TMN: Function-splitting
|
||||
}
|
||||
}
|
||||
|
||||
__declspec(naked)
|
||||
void KiV86Complete()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
/* Restore the original ebp */
|
||||
mov ebp, TF_ORIG_EBP[esp]
|
||||
|
||||
/* Get a pointer to the OUT_REGS structure */
|
||||
mov ebx, 12[ebp] // OutRegs
|
||||
|
||||
/* Skip debug information and unsaved registers */
|
||||
add esp, 0x30
|
||||
|
||||
/* Ignore 32-bit segment registers */
|
||||
add esp, 12
|
||||
|
||||
/* Save the vm86 registers into the OUT_REGS structure */
|
||||
pop dword ptr KV86M_REGISTERS_EDX[ebx]
|
||||
pop dword ptr KV86M_REGISTERS_ECX[ebx]
|
||||
pop dword ptr KV86M_REGISTERS_EAX[ebx]
|
||||
|
||||
/* Restore the old previous mode */
|
||||
pop eax
|
||||
mov ss:KTHREAD_PREVIOUS_MODE[esi], al
|
||||
|
||||
/* Restore the old exception handler list */
|
||||
pop eax
|
||||
mov fs:KPCR_EXCEPTION_LIST, eax
|
||||
|
||||
/* Ignore the 32-bit fs register */
|
||||
add esp, 4
|
||||
|
||||
pop dword ptr KV86M_REGISTERS_EDI[ebx]
|
||||
pop dword ptr KV86M_REGISTERS_ESI[ebx]
|
||||
pop dword ptr KV86M_REGISTERS_EBX[ebx]
|
||||
pop dword ptr KV86M_REGISTERS_EBP[ebx]
|
||||
|
||||
/* Ignore error code */
|
||||
add esp, 4
|
||||
|
||||
pop dword ptr KV86M_REGISTERS_EIP[ebx]
|
||||
pop dword ptr KV86M_REGISTERS_CS[ebx]
|
||||
pop dword ptr KV86M_REGISTERS_EFLAGS[ebx]
|
||||
pop dword ptr KV86M_REGISTERS_ESP[ebx]
|
||||
pop dword ptr KV86M_REGISTERS_SS[ebx]
|
||||
pop dword ptr KV86M_REGISTERS_ES[ebx]
|
||||
pop dword ptr KV86M_REGISTERS_DS[ebx]
|
||||
pop dword ptr KV86M_REGISTERS_FS[ebx]
|
||||
pop dword ptr KV86M_REGISTERS_GS[ebx]
|
||||
|
||||
/*
|
||||
* We are going to fiddle with the stack so this must be a critical
|
||||
* section for this process
|
||||
*/
|
||||
cli
|
||||
|
||||
/*
|
||||
* Restore the initial stack
|
||||
*/
|
||||
pop eax
|
||||
mov esi, fs:KPCR_TSS
|
||||
mov KTSS_ESP0[esi], eax
|
||||
|
||||
/*
|
||||
* We also need to set the stack in the kthread structure
|
||||
*/
|
||||
mov esi, fs:KPCR_CURRENT_THREAD
|
||||
mov edi, KTHREAD_INITIAL_STACK[esi]
|
||||
mov KTHREAD_INITIAL_STACK[esi], eax
|
||||
|
||||
/* Exit the critical section */
|
||||
sti
|
||||
|
||||
/* Ignore IN_REGS pointer */
|
||||
add esp, 4
|
||||
|
||||
/* Ignore ebp restored above */
|
||||
add esp, 4
|
||||
|
||||
/* Return to caller */
|
||||
popad
|
||||
mov esp, ebp
|
||||
pop ebp
|
||||
ret
|
||||
|
||||
} // end of __asm block
|
||||
}
|
15
msvc6/ntoskrnl/linkorder.txt
Normal file
15
msvc6/ntoskrnl/linkorder.txt
Normal file
@@ -0,0 +1,15 @@
|
||||
; This file is vital. It tells the linker how to order some functions
|
||||
; and some data, that unfortunately is assumed to be at low location
|
||||
; and in known order to eachother respectively?
|
||||
|
||||
MultibootStub
|
||||
our_memmove
|
||||
dummy_placeholder
|
||||
NtProcessStartup@4
|
||||
initialize_page_directory
|
||||
relocate_pointer_log_to_phys
|
||||
; Order some data that there is some assumptions about...
|
||||
init_stack
|
||||
init_stack_top
|
||||
trap_stack
|
||||
trap_stack_top
|
126
msvc6/ntoskrnl/mm_i386_memsafe.c
Normal file
126
msvc6/ntoskrnl/mm_i386_memsafe.c
Normal file
@@ -0,0 +1,126 @@
|
||||
#include <ddk/ntddk.h>
|
||||
|
||||
|
||||
void MmSafeCopyToUserRestart();
|
||||
void MmSafeCopyToUserUnsafeStart();
|
||||
void MmSafeCopyFromUserUnsafeStart();
|
||||
void MmSafeCopyFromUserRestart();
|
||||
|
||||
/*
|
||||
* NTSTATUS MmSafeCopyFromUser(PVOID Dest, PVOID Src,
|
||||
* ULONG NumberOfBytes)
|
||||
*/
|
||||
__declspec(naked)
|
||||
NTSTATUS MmSafeCopyFromUser(PVOID Dest, const VOID *Src, ULONG Count)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push ebp
|
||||
mov ebp,esp
|
||||
|
||||
push esi
|
||||
push edi
|
||||
push ecx
|
||||
|
||||
mov edi, 8[ebp]
|
||||
mov esi, 12[ebp]
|
||||
mov ecx, 16[ebp]
|
||||
|
||||
/*
|
||||
* Default return code
|
||||
*/
|
||||
xor eax,eax
|
||||
|
||||
jmp MmSafeCopyFromUserUnsafeStart
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
__declspec(naked)
|
||||
void MmSafeCopyFromUserUnsafeStart()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
/*
|
||||
* This is really a synthetic instruction since if we incur a
|
||||
* pagefault then eax will be set to an appropiate STATUS code
|
||||
*/
|
||||
cld
|
||||
rep movsb
|
||||
|
||||
jmp MmSafeCopyFromUserRestart
|
||||
}
|
||||
}
|
||||
|
||||
__declspec(naked)
|
||||
void MmSafeCopyFromUserRestart()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
pop ecx
|
||||
pop edi
|
||||
pop esi
|
||||
|
||||
pop ebp
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
* NTSTATUS MmSafeCopyToUser(PVOID Dest, PVOID Src,
|
||||
* ULONG NumberOfBytes)
|
||||
*/
|
||||
NTSTATUS MmSafeCopyToUser(PVOID Dest, const VOID *Src, ULONG Count)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push ebp
|
||||
mov esp,ebp
|
||||
|
||||
push esi
|
||||
push edi
|
||||
push ecx
|
||||
|
||||
mov edi, 8[ebp]
|
||||
mov esi, 12[ebp]
|
||||
mov ecx, 16[ebp]
|
||||
|
||||
/*
|
||||
* Default return code
|
||||
*/
|
||||
xor eax,eax
|
||||
|
||||
jmp MmSafeCopyToUserUnsafeStart
|
||||
}
|
||||
}
|
||||
|
||||
__declspec(naked)
|
||||
void MmSafeCopyToUserUnsafeStart()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
/*
|
||||
* This is really a synthetic instruction since if we incur a
|
||||
* pagefault then eax will be set to an appropiate STATUS code
|
||||
*/
|
||||
cld
|
||||
rep movsb
|
||||
jmp MmSafeCopyToUserRestart
|
||||
}
|
||||
}
|
||||
|
||||
__declspec(naked)
|
||||
void MmSafeCopyToUserRestart()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
pop ecx
|
||||
pop edi
|
||||
pop esi
|
||||
|
||||
pop ebp
|
||||
ret
|
||||
}
|
||||
}
|
574
msvc6/ntoskrnl/mm_mminit_msvc.c
Normal file
574
msvc6/ntoskrnl/mm_mminit_msvc.c
Normal file
@@ -0,0 +1,574 @@
|
||||
/* $Id: mm_mminit_msvc.c,v 1.1 2004/02/06 08:22:01 fireball Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top directory
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: ntoskrnl/mm/mminit.c
|
||||
* PURPOSE: kernel memory managment initialization functions
|
||||
* PROGRAMMER: David Welch (welch@cwcom.net)
|
||||
* UPDATE HISTORY:
|
||||
* Created 9/4/98
|
||||
*/
|
||||
|
||||
/* INCLUDES *****************************************************************/
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <roscfg.h>
|
||||
#include <internal/i386/segment.h>
|
||||
#include <internal/mm.h>
|
||||
#include <internal/ntoskrnl.h>
|
||||
#include <internal/io.h>
|
||||
#include <internal/ps.h>
|
||||
#include <internal/pool.h>
|
||||
|
||||
#define NDEBUG
|
||||
#include <internal/debug.h>
|
||||
|
||||
/* GLOBALS *****************************************************************/
|
||||
|
||||
/*
|
||||
* Size of extended memory (kb) (fixed for now)
|
||||
*/
|
||||
#define EXTENDED_MEMORY_SIZE (3*1024*1024)
|
||||
|
||||
/*
|
||||
* Compiler defined symbols
|
||||
*/
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
|
||||
#pragma intrinsic(strcmp)
|
||||
|
||||
static PIMAGE_SECTION_HEADER FindSection(const char* szSeg)
|
||||
{
|
||||
PIMAGE_NT_HEADERS NtHeader = RtlImageNtHeader((PVOID)KERNEL_BASE);
|
||||
PIMAGE_SECTION_HEADER Section = IMAGE_FIRST_SECTION(NtHeader);
|
||||
const int count = NtHeader->FileHeader.NumberOfSections;
|
||||
int i;
|
||||
for (i = 0; i < count; ++i, ++Section)
|
||||
{
|
||||
if (!strcmp(szSeg, Section->Name))
|
||||
{
|
||||
return Section;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void* FindSegmentStart(const char* szSeg)
|
||||
{
|
||||
PIMAGE_SECTION_HEADER Section = FindSection(szSeg);
|
||||
if (Section)
|
||||
{
|
||||
return (void*)(KERNEL_BASE + Section->VirtualAddress);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void* FindSegmentEnd(const char* szSeg)
|
||||
{
|
||||
PIMAGE_SECTION_HEADER Section = FindSection(szSeg);
|
||||
if (Section)
|
||||
{
|
||||
return (void*)(KERNEL_BASE + Section->VirtualAddress + Section->Misc.VirtualSize);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif // defined(_MSC_VER)
|
||||
|
||||
|
||||
static BOOLEAN IsThisAnNtAsSystem = FALSE;
|
||||
static MM_SYSTEM_SIZE MmSystemSize = MmSmallSystem;
|
||||
|
||||
static MEMORY_AREA* kernel_text_desc = NULL;
|
||||
static MEMORY_AREA* kernel_init_desc = NULL;
|
||||
static MEMORY_AREA* kernel_map_desc = NULL;
|
||||
static MEMORY_AREA* kernel_kpcr_desc = NULL;
|
||||
static MEMORY_AREA* kernel_data_desc = NULL;
|
||||
static MEMORY_AREA* kernel_param_desc = NULL;
|
||||
static MEMORY_AREA* kernel_pool_desc = NULL;
|
||||
static MEMORY_AREA* kernel_shared_data_desc = NULL;
|
||||
static MEMORY_AREA* kernel_mapped_low_mem_desc = NULL;
|
||||
static MEMORY_AREA* MiKernelMapDescriptor = NULL;
|
||||
static MEMORY_AREA* MiPagedPoolDescriptor = NULL;
|
||||
|
||||
PHYSICAL_ADDRESS MmSharedDataPagePhysicalAddress;
|
||||
|
||||
PVOID MiNonPagedPoolStart;
|
||||
ULONG MiNonPagedPoolLength;
|
||||
PVOID MiKernelMapStart;
|
||||
ULONG MiKernelMapLength;
|
||||
|
||||
/* FUNCTIONS ****************************************************************/
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
BOOLEAN STDCALL MmIsThisAnNtAsSystem(VOID)
|
||||
{
|
||||
return(IsThisAnNtAsSystem);
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
MM_SYSTEM_SIZE STDCALL MmQuerySystemSize(VOID)
|
||||
{
|
||||
return(MmSystemSize);
|
||||
}
|
||||
|
||||
VOID MiShutdownMemoryManager(VOID)
|
||||
{
|
||||
}
|
||||
|
||||
VOID INIT_FUNCTION
|
||||
MmInitVirtualMemory(ULONG LastKernelAddress,
|
||||
ULONG KernelLength)
|
||||
/*
|
||||
* FUNCTION: Intialize the memory areas list
|
||||
* ARGUMENTS:
|
||||
* bp = Pointer to the boot parameters
|
||||
* kernel_len = Length of the kernel
|
||||
*/
|
||||
{
|
||||
PVOID BaseAddress;
|
||||
ULONG Length;
|
||||
ULONG ParamLength = KernelLength;
|
||||
NTSTATUS Status;
|
||||
PHYSICAL_ADDRESS BoundaryAddressMultiple;
|
||||
//ULONG i;
|
||||
|
||||
DPRINT("MmInitVirtualMemory(%x, %x)\n",LastKernelAddress, KernelLength);
|
||||
|
||||
BoundaryAddressMultiple.QuadPart = 0;
|
||||
LastKernelAddress = PAGE_ROUND_UP(LastKernelAddress);
|
||||
|
||||
MmInitMemoryAreas();
|
||||
|
||||
/* Don't change the start of kernel map. Pte's must always exist for this region. */
|
||||
MiKernelMapStart = (char*)LastKernelAddress + PAGE_SIZE;
|
||||
MiKernelMapLength = MM_KERNEL_MAP_SIZE;
|
||||
|
||||
MiNonPagedPoolStart = (char*)MiKernelMapStart + MiKernelMapLength + PAGE_SIZE;
|
||||
MiNonPagedPoolLength = MM_NONPAGED_POOL_SIZE;
|
||||
|
||||
MmPagedPoolBase = (char*)MiNonPagedPoolStart + MiNonPagedPoolLength + PAGE_SIZE;
|
||||
MmPagedPoolSize = MM_PAGED_POOL_SIZE;
|
||||
|
||||
MiInitKernelMap();
|
||||
MiInitializeNonPagedPool();
|
||||
|
||||
/*
|
||||
* Setup the system area descriptor list
|
||||
*/
|
||||
BaseAddress = (PVOID)0xf0000000;
|
||||
MmCreateMemoryArea(NULL,
|
||||
MmGetKernelAddressSpace(),
|
||||
MEMORY_AREA_SYSTEM,
|
||||
&BaseAddress,
|
||||
0x400000,
|
||||
0,
|
||||
&kernel_map_desc,
|
||||
FALSE,
|
||||
FALSE,
|
||||
BoundaryAddressMultiple);
|
||||
|
||||
BaseAddress = (PVOID)KPCR_BASE;
|
||||
MmCreateMemoryArea(NULL,
|
||||
MmGetKernelAddressSpace(),
|
||||
MEMORY_AREA_SYSTEM,
|
||||
&BaseAddress,
|
||||
PAGE_SIZE * MAXIMUM_PROCESSORS,
|
||||
0,
|
||||
&kernel_kpcr_desc,
|
||||
FALSE,
|
||||
FALSE,
|
||||
BoundaryAddressMultiple);
|
||||
|
||||
BaseAddress = (PVOID)0xd0000000;
|
||||
MmCreateMemoryArea(NULL,
|
||||
MmGetKernelAddressSpace(),
|
||||
MEMORY_AREA_SYSTEM,
|
||||
&BaseAddress,
|
||||
0x100000,
|
||||
0,
|
||||
&kernel_mapped_low_mem_desc,
|
||||
FALSE,
|
||||
FALSE,
|
||||
BoundaryAddressMultiple);
|
||||
|
||||
BaseAddress = (PVOID)KERNEL_BASE;
|
||||
Length = PAGE_ROUND_UP(((ULONG)FindSegmentEnd(".text"))) - KERNEL_BASE;
|
||||
ParamLength = ParamLength - Length;
|
||||
|
||||
/*
|
||||
* No need to lock the address space at this point since no
|
||||
* other threads are running.
|
||||
*/
|
||||
MmCreateMemoryArea(NULL,
|
||||
MmGetKernelAddressSpace(),
|
||||
MEMORY_AREA_SYSTEM,
|
||||
&BaseAddress,
|
||||
Length,
|
||||
0,
|
||||
&kernel_text_desc,
|
||||
FALSE,
|
||||
FALSE,
|
||||
BoundaryAddressMultiple);
|
||||
// TODO: Here we REALLY should iterate the PE's sections and set protection
|
||||
// accordingly for each and every one of them.
|
||||
|
||||
// NOTE This code ONLY works because of the assumption that the .text
|
||||
// segment is the first in the PE, and the .reloc segment is the last.
|
||||
// Link in a way to make this assumtion false, and the kernel won't work.
|
||||
BaseAddress = (PVOID)PAGE_ROUND_UP(((ULONG)FindSegmentEnd(".text")));
|
||||
Length = PAGE_ROUND_UP(((ULONG)FindSegmentStart(".reloc"))) - (ULONG_PTR)BaseAddress;
|
||||
ParamLength = ParamLength - Length;
|
||||
DPRINT1("Data Length %x\n",Length);
|
||||
DPRINT1("Data BaseAddress %x\n",BaseAddress);
|
||||
|
||||
/*
|
||||
* No need to lock the address space at this point since we are
|
||||
* the only thread running.
|
||||
*/
|
||||
// For GCC-compiled, kernel_data_desc contains:
|
||||
// .data, .edata, .idata, .bss and .rsrc. E.i. all but .text and .reloc
|
||||
MmCreateMemoryArea(NULL,
|
||||
MmGetKernelAddressSpace(),
|
||||
MEMORY_AREA_SYSTEM,
|
||||
&BaseAddress,
|
||||
Length,
|
||||
0,
|
||||
&kernel_data_desc,
|
||||
FALSE,
|
||||
FALSE,
|
||||
BoundaryAddressMultiple);
|
||||
|
||||
// BaseAddress = (PVOID)PAGE_ROUND_UP(((ULONG)FindSegmentEnd(".edata")));
|
||||
BaseAddress = (PVOID)PAGE_ROUND_UP(((ULONG)FindSegmentStart(".reloc")));
|
||||
Length = LastKernelAddress - (ULONG)BaseAddress;
|
||||
// For GCC-compiled, kernel_param_desc contains .reloc
|
||||
MmCreateMemoryArea(NULL,
|
||||
MmGetKernelAddressSpace(),
|
||||
MEMORY_AREA_SYSTEM,
|
||||
&BaseAddress,
|
||||
Length,
|
||||
0,
|
||||
&kernel_param_desc,
|
||||
FALSE,
|
||||
FALSE,
|
||||
BoundaryAddressMultiple);
|
||||
|
||||
BaseAddress = MiNonPagedPoolStart;
|
||||
MmCreateMemoryArea(NULL,
|
||||
MmGetKernelAddressSpace(),
|
||||
MEMORY_AREA_SYSTEM,
|
||||
&BaseAddress,
|
||||
MiNonPagedPoolLength,
|
||||
0,
|
||||
&kernel_pool_desc,
|
||||
FALSE,
|
||||
FALSE,
|
||||
BoundaryAddressMultiple);
|
||||
|
||||
BaseAddress = MiKernelMapStart;
|
||||
Status = MmCreateMemoryArea(NULL,
|
||||
MmGetKernelAddressSpace(),
|
||||
MEMORY_AREA_SYSTEM,
|
||||
&BaseAddress,
|
||||
MiKernelMapLength,
|
||||
0,
|
||||
&MiKernelMapDescriptor,
|
||||
FALSE,
|
||||
FALSE,
|
||||
BoundaryAddressMultiple);
|
||||
|
||||
BaseAddress = MmPagedPoolBase;
|
||||
Status = MmCreateMemoryArea(NULL,
|
||||
MmGetKernelAddressSpace(),
|
||||
MEMORY_AREA_PAGED_POOL,
|
||||
&BaseAddress,
|
||||
MmPagedPoolSize,
|
||||
0,
|
||||
&MiPagedPoolDescriptor,
|
||||
FALSE,
|
||||
FALSE,
|
||||
BoundaryAddressMultiple);
|
||||
|
||||
MmInitializePagedPool();
|
||||
|
||||
/*
|
||||
* Create the kernel mapping of the user/kernel shared memory.
|
||||
*/
|
||||
BaseAddress = (PVOID)KI_USER_SHARED_DATA;
|
||||
Length = PAGE_SIZE;
|
||||
MmCreateMemoryArea(NULL,
|
||||
MmGetKernelAddressSpace(),
|
||||
MEMORY_AREA_SYSTEM,
|
||||
&BaseAddress,
|
||||
Length,
|
||||
0,
|
||||
&kernel_shared_data_desc,
|
||||
FALSE,
|
||||
FALSE,
|
||||
BoundaryAddressMultiple);
|
||||
|
||||
Status = MmRequestPageMemoryConsumer(MC_NPPOOL, TRUE,
|
||||
&MmSharedDataPagePhysicalAddress);
|
||||
Status = MmCreateVirtualMapping(NULL,
|
||||
(PVOID)KI_USER_SHARED_DATA,
|
||||
PAGE_READWRITE,
|
||||
MmSharedDataPagePhysicalAddress,
|
||||
TRUE);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DbgPrint("Unable to create virtual mapping\n");
|
||||
KEBUGCHECK(0);
|
||||
}
|
||||
RtlZeroMemory(BaseAddress, Length);
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
MmInitializeMemoryConsumer(MC_USER, MmTrimUserMemory);
|
||||
}
|
||||
|
||||
|
||||
VOID INIT_FUNCTION
|
||||
MmInit1(ULONG FirstKrnlPhysAddr,
|
||||
ULONG LastKrnlPhysAddr,
|
||||
ULONG LastKernelAddress,
|
||||
PADDRESS_RANGE BIOSMemoryMap,
|
||||
ULONG AddressRangeCount,
|
||||
ULONG MaxMem)
|
||||
/*
|
||||
* FUNCTION: Initalize memory managment
|
||||
*/
|
||||
{
|
||||
ULONG i;
|
||||
ULONG kernel_len;
|
||||
#ifndef MP
|
||||
extern unsigned int unmap_me, unmap_me2, unmap_me3;
|
||||
#endif
|
||||
|
||||
DPRINT("MmInit1(FirstKrnlPhysAddr, %x, LastKrnlPhysAddr %x, LastKernelAddress %x)\n",
|
||||
FirstKrnlPhysAddr,
|
||||
LastKrnlPhysAddr,
|
||||
LastKernelAddress);
|
||||
|
||||
|
||||
if ((BIOSMemoryMap != NULL) && (AddressRangeCount > 0))
|
||||
{
|
||||
// If we have a bios memory map, recalulate the memory size
|
||||
ULONG last = 0;
|
||||
for (i = 0; i < AddressRangeCount; i++)
|
||||
{
|
||||
if (BIOSMemoryMap[i].Type == 1
|
||||
&& (BIOSMemoryMap[i].BaseAddrLow + BIOSMemoryMap[i].LengthLow + PAGE_SIZE -1) / PAGE_SIZE > last)
|
||||
{
|
||||
last = (BIOSMemoryMap[i].BaseAddrLow + BIOSMemoryMap[i].LengthLow + PAGE_SIZE -1) / PAGE_SIZE;
|
||||
}
|
||||
}
|
||||
if ((last - 256) * 4 > KeLoaderBlock.MemHigher)
|
||||
{
|
||||
KeLoaderBlock.MemHigher = (last - 256) * 4;
|
||||
}
|
||||
}
|
||||
|
||||
if (KeLoaderBlock.MemHigher >= (MaxMem - 1) * 1024)
|
||||
{
|
||||
KeLoaderBlock.MemHigher = (MaxMem - 1) * 1024;
|
||||
}
|
||||
|
||||
/*
|
||||
* FIXME: Set this based on the system command line
|
||||
*/
|
||||
MmSystemRangeStart = (PVOID)KERNEL_BASE; // 0xC0000000
|
||||
MmUserProbeAddress = (PVOID)0x7fff0000;
|
||||
MmHighestUserAddress = (PVOID)0x7ffeffff;
|
||||
|
||||
MmInitGlobalKernelPageDirectory();
|
||||
|
||||
/*
|
||||
* Initialize memory managment statistics
|
||||
*/
|
||||
MmStats.NrTotalPages = 0;
|
||||
MmStats.NrSystemPages = 0;
|
||||
MmStats.NrUserPages = 0;
|
||||
MmStats.NrReservedPages = 0;
|
||||
MmStats.NrUserPages = 0;
|
||||
MmStats.NrFreePages = 0;
|
||||
MmStats.NrLockedPages = 0;
|
||||
MmStats.PagingRequestsInLastMinute = 0;
|
||||
MmStats.PagingRequestsInLastFiveMinutes = 0;
|
||||
MmStats.PagingRequestsInLastFifteenMinutes = 0;
|
||||
|
||||
/*
|
||||
* Initialize the kernel address space
|
||||
*/
|
||||
MmInitializeKernelAddressSpace();
|
||||
|
||||
/*
|
||||
* Unmap low memory
|
||||
*/
|
||||
#ifndef MP
|
||||
/* In SMP mode we unmap the low memory in MmInit3.
|
||||
The APIC needs the mapping of the first pages
|
||||
while the processors are starting up. */
|
||||
MmDeletePageTable(NULL, 0);
|
||||
#endif
|
||||
/*
|
||||
* Free all pages not used for kernel memory
|
||||
* (we assume the kernel occupies a continuous range of physical
|
||||
* memory)
|
||||
*/
|
||||
DPRINT("first krnl %x\nlast krnl %x\n",FirstKrnlPhysAddr,
|
||||
LastKrnlPhysAddr);
|
||||
|
||||
/*
|
||||
* Free physical memory not used by the kernel
|
||||
*/
|
||||
MmStats.NrTotalPages = KeLoaderBlock.MemHigher/4;
|
||||
if (!MmStats.NrTotalPages)
|
||||
{
|
||||
DbgPrint("Memory not detected, default to 8 MB\n");
|
||||
MmStats.NrTotalPages = 2048;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* add 1MB for standard memory (not extended) */
|
||||
MmStats.NrTotalPages += 256;
|
||||
}
|
||||
#ifdef BIOS_MEM_FIX
|
||||
MmStats.NrTotalPages += 16;
|
||||
#endif
|
||||
DbgPrint("Used memory %dKb\n", (MmStats.NrTotalPages * PAGE_SIZE) / 1024);
|
||||
|
||||
LastKernelAddress = (ULONG)MmInitializePageList((PVOID)FirstKrnlPhysAddr,
|
||||
(PVOID)LastKrnlPhysAddr,
|
||||
MmStats.NrTotalPages,
|
||||
PAGE_ROUND_UP(LastKernelAddress),
|
||||
BIOSMemoryMap,
|
||||
AddressRangeCount);
|
||||
kernel_len = LastKrnlPhysAddr - FirstKrnlPhysAddr;
|
||||
|
||||
/*
|
||||
* Create a trap for null pointer references and protect text
|
||||
* segment
|
||||
*/
|
||||
CHECKPOINT;
|
||||
#if defined(_MSC_VER)
|
||||
DPRINT(".text start: %x, .data start: %x\n",
|
||||
(int)FindSegmentStart(".text"),
|
||||
(int)FindSegmentStart(".data"));
|
||||
|
||||
{
|
||||
const char* pCode = FindSegmentStart(".text");
|
||||
const char* pData = FindSegmentEnd(".text");
|
||||
while (pCode < pData)
|
||||
{
|
||||
MmSetPageProtect(NULL, (PVOID)pCode, PAGE_EXECUTE_READ);
|
||||
pCode += PAGE_SIZE;
|
||||
}
|
||||
}
|
||||
#else
|
||||
DPRINT("_text_start__ %x _init_end__ %x\n",(int)&_text_start__,(int)&_init_end__);
|
||||
for (i=PAGE_ROUND_DOWN(((int)&_text_start__));
|
||||
i<PAGE_ROUND_UP(((int)&_init_end__));i=i+PAGE_SIZE)
|
||||
{
|
||||
MmSetPageProtect(NULL,
|
||||
(PVOID)i,
|
||||
PAGE_EXECUTE_READ);
|
||||
}
|
||||
#endif
|
||||
|
||||
DPRINT("Invalidating between %x and %x\n",
|
||||
LastKernelAddress, 0xc0600000);
|
||||
for (i=(LastKernelAddress); i<0xc0600000; i+=PAGE_SIZE)
|
||||
{
|
||||
MmRawDeleteVirtualMapping((PVOID)(i));
|
||||
}
|
||||
|
||||
DPRINT("Invalidating between %x and %x\n",
|
||||
0xd0100000, 0xd0400000);
|
||||
for (i=0xd0100000; i<0xd0400000; i+=PAGE_SIZE)
|
||||
{
|
||||
MmRawDeleteVirtualMapping((PVOID)(i));
|
||||
}
|
||||
|
||||
DPRINT("Almost done MmInit()\n");
|
||||
#ifndef MP
|
||||
/* FIXME: This is broken in SMP mode */
|
||||
#if !defined(_MSC_VER) // FIXME: I don't trust using this from MSVC yet!
|
||||
MmDeleteVirtualMapping(NULL, (PVOID)&unmap_me, TRUE, NULL, NULL);
|
||||
MmDeleteVirtualMapping(NULL, (PVOID)&unmap_me2, TRUE, NULL, NULL);
|
||||
MmDeleteVirtualMapping(NULL, (PVOID)&unmap_me3, TRUE, NULL, NULL);
|
||||
#endif // _MSC_VER
|
||||
#endif
|
||||
/*
|
||||
* Intialize memory areas
|
||||
*/
|
||||
MmInitVirtualMemory(LastKernelAddress, kernel_len);
|
||||
|
||||
MmInitializeMdlImplementation();
|
||||
}
|
||||
|
||||
VOID INIT_FUNCTION
|
||||
MmInit2(VOID)
|
||||
{
|
||||
MmInitializeRmapList();
|
||||
MmInitializePageOp();
|
||||
MmInitSectionImplementation();
|
||||
MmInitPagingFile();
|
||||
}
|
||||
|
||||
VOID INIT_FUNCTION
|
||||
MmInit3(VOID)
|
||||
{
|
||||
/*
|
||||
* Unmap low memory
|
||||
*/
|
||||
#ifdef MP
|
||||
/* In SMP mode we can unmap the low memory
|
||||
if all processors are started. */
|
||||
MmDeletePageTable(NULL, 0);
|
||||
#endif
|
||||
MmInitZeroPageThread();
|
||||
MmCreatePhysicalMemorySection();
|
||||
MiInitBalancerThread();
|
||||
|
||||
/*
|
||||
* Initialise the modified page writer.
|
||||
*/
|
||||
MmInitMpwThread();
|
||||
|
||||
/* FIXME: Read parameters from memory */
|
||||
}
|
||||
|
||||
VOID STATIC
|
||||
MiFreeInitMemoryPage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address,
|
||||
PHYSICAL_ADDRESS PhysAddr, SWAPENTRY SwapEntry,
|
||||
BOOLEAN Dirty)
|
||||
{
|
||||
assert(SwapEntry == 0);
|
||||
if (PhysAddr.QuadPart != 0)
|
||||
{
|
||||
MmReleasePageMemoryConsumer(MC_NPPOOL, PhysAddr);
|
||||
}
|
||||
}
|
||||
|
||||
VOID
|
||||
MiFreeInitMemory(VOID)
|
||||
{
|
||||
#if defined(_MSC_VER)
|
||||
DPRINT1("Can not yet free .init memory for MSVC compiled kernel\n");
|
||||
#else
|
||||
MmLockAddressSpace(MmGetKernelAddressSpace());
|
||||
MmFreeMemoryArea(MmGetKernelAddressSpace(),
|
||||
(PVOID)&_init_start__,
|
||||
PAGE_ROUND_UP((ULONG)&_init_end__) - (ULONG)_init_start__,
|
||||
MiFreeInitMemoryPage,
|
||||
NULL);
|
||||
MmUnlockAddressSpace(MmGetKernelAddressSpace());
|
||||
#endif
|
||||
}
|
3271
msvc6/ntoskrnl/ntoskrnl.dsp
Normal file
3271
msvc6/ntoskrnl/ntoskrnl.dsp
Normal file
File diff suppressed because it is too large
Load Diff
299
msvc6/ntoskrnl/rtl_i386_except.c
Normal file
299
msvc6/ntoskrnl/rtl_i386_except.c
Normal file
@@ -0,0 +1,299 @@
|
||||
/*
|
||||
* ReactOS kernel
|
||||
* Copyright (C) 2000 David Welch <welch@cwcom.net>
|
||||
*
|
||||
* Moved to MSVC-compatible inline assembler by Mike Nordell, 2003-12-26
|
||||
*
|
||||
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/*
|
||||
* FILE: ntoskrnl/ke/i386/vm86_sup.S
|
||||
* PURPOSE: V86 mode support
|
||||
* PROGRAMMER: David Welch (welch@cwcom.net)
|
||||
* UPDATE HISTORY:
|
||||
* Created 09/10/00
|
||||
*/
|
||||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#pragma hdrstop
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
#include <ddk/status.h>
|
||||
#include <internal/i386/segment.h>
|
||||
#include <internal/i386/fpu.h>
|
||||
#include <internal/ps.h>
|
||||
#include <ddk/defines.h>
|
||||
#include <internal/v86m.h>
|
||||
#include <ntos/tss.h>
|
||||
//#include <ntos/service.h>
|
||||
#include <internal/trap.h>
|
||||
#include <internal/ps.h>
|
||||
|
||||
#include <roscfg.h>
|
||||
#include <internal/ntoskrnl.h>
|
||||
#include <internal/i386/segment.h>
|
||||
|
||||
|
||||
#define EXCEPTION_UNWINDING 0x02
|
||||
|
||||
#define EREC_FLAGS 0x04
|
||||
|
||||
#define ExceptionContinueExecution 0
|
||||
#define ExceptionContinueSearch 1
|
||||
#define ExceptionNestedException 2
|
||||
#define ExceptionCollidedUnwind 3
|
||||
|
||||
//.globl _RtlpExecuteHandlerForException
|
||||
//.globl _RtlpExecuteHandlerForUnwind
|
||||
|
||||
#define CONTEXT_FLAGS 0x00
|
||||
#define CONTEXT_SEGGS 0x8C
|
||||
#define CONTEXT_SEGFS 0x90
|
||||
#define CONTEXT_SEGES 0x94
|
||||
#define CONTEXT_SEGDS 0x98
|
||||
#define CONTEXT_EDI 0x9C
|
||||
#define CONTEXT_ESI 0xA0
|
||||
#define CONTEXT_EBX 0xA4
|
||||
#define CONTEXT_EDX 0xA8
|
||||
#define CONTEXT_ECX 0xAC
|
||||
#define CONTEXT_EAX 0xB0
|
||||
#define CONTEXT_EBP 0xB4
|
||||
#define CONTEXT_EIP 0xB8
|
||||
#define CONTEXT_SEGCS 0xBC
|
||||
#define CONTEXT_EFLAGS 0xC0
|
||||
#define CONTEXT_ESP 0xC4
|
||||
#define CONTEXT_SEGSS 0xC8
|
||||
|
||||
|
||||
#define RCC_CONTEXT 0x08
|
||||
|
||||
|
||||
VOID STDCALL
|
||||
AsmDebug(ULONG Value);
|
||||
|
||||
|
||||
// EAX = value to print
|
||||
__declspec(naked)
|
||||
void do_debug()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
pusha
|
||||
push eax
|
||||
call AsmDebug
|
||||
popa
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#define REH_ERECORD 0x08
|
||||
#define REH_RFRAME 0x0C
|
||||
#define REH_CONTEXT 0x10
|
||||
#define REH_DCONTEXT 0x14
|
||||
#define REH_EROUTINE 0x18
|
||||
|
||||
// Parameters:
|
||||
// None
|
||||
// Registers:
|
||||
// [EBP+08h] - PEXCEPTION_RECORD ExceptionRecord
|
||||
// [EBP+0Ch] - PEXCEPTION_REGISTRATION RegistrationFrame
|
||||
// [EBP+10h] - PVOID Context
|
||||
// [EBP+14h] - PVOID DispatcherContext
|
||||
// [EBP+18h] - PEXCEPTION_HANDLER ExceptionRoutine
|
||||
// EDX - Address of protecting exception handler
|
||||
// Returns:
|
||||
// EXCEPTION_DISPOSITION
|
||||
// Notes:
|
||||
// Setup the protecting exception handler and call the exception
|
||||
// handler in the right context.
|
||||
__declspec(naked)
|
||||
void RtlpExecuteHandler()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
push REH_RFRAME[ebp]
|
||||
|
||||
push edx
|
||||
push fs:0x0
|
||||
mov fs:0x0, esp
|
||||
|
||||
// Prepare to call the exception handler
|
||||
push REH_DCONTEXT[ebp]
|
||||
push REH_CONTEXT[ebp]
|
||||
push REH_RFRAME[ebp]
|
||||
push REH_ERECORD[ebp]
|
||||
|
||||
// Now call the exception handler
|
||||
mov eax, REH_EROUTINE[ebp]
|
||||
call eax
|
||||
|
||||
cmp fs:0x0, -1
|
||||
jne reh_stack_looks_ok
|
||||
|
||||
// This should not happen
|
||||
push 0
|
||||
push 0
|
||||
push 0
|
||||
push 0
|
||||
call RtlAssert
|
||||
|
||||
reh_loop:
|
||||
jmp reh_loop
|
||||
|
||||
reh_stack_looks_ok:
|
||||
mov esp, fs:0x0
|
||||
|
||||
// Return to the 'front-end' for this function
|
||||
pop dword ptr fs:0x0
|
||||
mov esp, ebp
|
||||
pop ebp
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
#endif // 0
|
||||
|
||||
#define REP_ERECORD 0x04
|
||||
#define REP_RFRAME 0x08
|
||||
#define REP_CONTEXT 0x0C
|
||||
#define REP_DCONTEXT 0x10
|
||||
|
||||
// Parameters:
|
||||
// [ESP+04h] - PEXCEPTION_RECORD ExceptionRecord
|
||||
// [ESP+08h] - PEXCEPTION_REGISTRATION RegistrationFrame
|
||||
// [ESP+0Ch] - PCONTEXT Context
|
||||
// [ESP+10h] - PVOID DispatcherContext
|
||||
// Registers:
|
||||
// None
|
||||
// Returns:
|
||||
// EXCEPTION_DISPOSITION
|
||||
// Notes:
|
||||
// This exception handler protects the exception handling
|
||||
// mechanism by detecting nested exceptions.
|
||||
__declspec(naked)
|
||||
void RtlpExceptionProtector()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
mov eax, ExceptionContinueSearch
|
||||
mov ecx, REP_ERECORD[esp]
|
||||
test EREC_FLAGS[ecx], EXCEPTION_UNWINDING
|
||||
jnz rep_end
|
||||
|
||||
// Unwinding is not taking place, so return ExceptionNestedException
|
||||
|
||||
// Set DispatcherContext field to the exception registration for the
|
||||
// exception handler that executed when a nested exception occurred
|
||||
mov ecx, REP_DCONTEXT[esp]
|
||||
mov eax, REP_RFRAME[esp]
|
||||
mov [ecx], eax
|
||||
mov eax, ExceptionNestedException
|
||||
|
||||
rep_end:
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Parameters:
|
||||
// [ESP+04h] - PEXCEPTION_RECORD ExceptionRecord
|
||||
// [ESP+08h] - PEXCEPTION_REGISTRATION RegistrationFrame
|
||||
// [ESP+0Ch] - PCONTEXT Context
|
||||
// [ESP+10h] - PVOID DispatcherContext
|
||||
// [ESP+14h] - PEXCEPTION_HANDLER ExceptionHandler
|
||||
// Registers:
|
||||
// None
|
||||
// Returns:
|
||||
// EXCEPTION_DISPOSITION
|
||||
// Notes:
|
||||
// Front-end
|
||||
__declspec(naked)
|
||||
void RtlpExecuteHandlerForException()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
mov edx, RtlpExceptionProtector
|
||||
jmp RtlpExecuteHandler
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#define RUP_ERECORD 0x04
|
||||
#define RUP_RFRAME 0x08
|
||||
#define RUP_CONTEXT 0x0C
|
||||
#define RUP_DCONTEXT 0x10
|
||||
|
||||
// Parameters:
|
||||
// [ESP+04h] - PEXCEPTION_RECORD ExceptionRecord
|
||||
// [ESP+08h] - PEXCEPTION_REGISTRATION RegistrationFrame
|
||||
// [ESP+0Ch] - PCONTEXT Context
|
||||
// [ESP+10h] - PVOID DispatcherContext
|
||||
// Registers:
|
||||
// None
|
||||
// Returns:
|
||||
// EXCEPTION_DISPOSITION
|
||||
// Notes:
|
||||
// This exception handler protects the exception handling
|
||||
// mechanism by detecting collided unwinds.
|
||||
__declspec(naked)
|
||||
void RtlpUnwindProtector()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
mov eax, ExceptionContinueSearch
|
||||
mov RUP_ERECORD[esp], ecx
|
||||
test EREC_FLAGS[ecx], EXCEPTION_UNWINDING
|
||||
jz rup_end
|
||||
|
||||
// Unwinding is taking place, so return ExceptionCollidedUnwind
|
||||
|
||||
mov ecx, RUP_RFRAME[esp]
|
||||
mov edx, RUP_DCONTEXT[esp]
|
||||
|
||||
// Set DispatcherContext field to the exception registration for the
|
||||
// exception handler that executed when a collision occurred
|
||||
mov eax, RUP_RFRAME[ecx]
|
||||
mov [edx], eax
|
||||
mov eax, ExceptionCollidedUnwind
|
||||
|
||||
rup_end:
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Parameters:
|
||||
// [ESP+04h] - PEXCEPTION_RECORD ExceptionRecord
|
||||
// [ESP+08h] - PEXCEPTION_REGISTRATION RegistrationFrame
|
||||
// [ESP+0Ch] - PCONTEXT Context
|
||||
// [ESP+10h] - PVOID DispatcherContext
|
||||
// [ESP+14h] - PEXCEPTION_HANDLER ExceptionHandler
|
||||
// Registers:
|
||||
// None
|
||||
// Returns:
|
||||
// EXCEPTION_DISPOSITION
|
||||
__declspec(naked)
|
||||
void RtlpExecuteHandlerForUnwind()
|
||||
{
|
||||
__asm mov edx, RtlpUnwindProtector
|
||||
__asm jmp RtlpExecuteHandler
|
||||
}
|
||||
|
37
os2/apps/bepslep/Makefile
Normal file
37
os2/apps/bepslep/Makefile
Normal file
@@ -0,0 +1,37 @@
|
||||
# $Id: Makefile,v 1.2 2003/01/07 16:23:10 robd Exp $
|
||||
#
|
||||
#
|
||||
|
||||
PATH_TO_TOP = ../../../reactos
|
||||
|
||||
PATH_TO_OS2_TOP = ../..
|
||||
|
||||
TARGET_TYPE = program
|
||||
|
||||
TARGET_NORC = yes
|
||||
|
||||
#TARGET_APPTYPE = console
|
||||
TARGET_APPTYPE = windows
|
||||
|
||||
TARGET_NAME = bepslep
|
||||
|
||||
TARGET_CFLAGS = -D__SUBSYSTEM_WINDOWS__
|
||||
|
||||
TARGET_LFLAGS = -nostartfiles
|
||||
|
||||
TARGET_SDKLIBS = doscalls.a
|
||||
|
||||
TARGET_GCCLIBS = stdc++
|
||||
|
||||
#TARGET_LIBS = $(PATH_TO_OS2_TOP)/lib/crt0w32.o \
|
||||
# $(PATH_TO_TOP)/dk/psx/lib/psxdll.a
|
||||
|
||||
# $(PATH_TO_OS2_TOP)/dll/doscalls.dll
|
||||
|
||||
TARGET_OBJECTS = $(TARGET_NAME).o
|
||||
|
||||
include $(PATH_TO_TOP)/rules.mak
|
||||
|
||||
include $(TOOLS_PATH)/helper.mk
|
||||
|
||||
# EOF
|
20
os2/apps/bepslep/bepslep.c
Normal file
20
os2/apps/bepslep/bepslep.c
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
#define INCL_DOSPROCESS
|
||||
#include "../../include/os2.h"
|
||||
//#include "../../include/ros2.h"
|
||||
|
||||
void Eingang()
|
||||
{
|
||||
DosBeep(3000,300);
|
||||
DosSleep(1000);
|
||||
DosBeep(4000,200);
|
||||
DosExit(0,0);
|
||||
}
|
||||
|
||||
void WinMainCRTStartup()
|
||||
{
|
||||
int a, b;
|
||||
a= b+3;
|
||||
b=a+3;
|
||||
Eingang();
|
||||
}
|
5
os2/apps/directory.xml
Normal file
5
os2/apps/directory.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<group>
|
||||
<directory name="bepslep">
|
||||
<xi:include href="bepslep/bepslep.xml" />
|
||||
</directory>
|
||||
</group>
|
11
os2/directory.xml
Normal file
11
os2/directory.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<group>
|
||||
<directory name="apps">
|
||||
<xi:include href="apps/directory.xml" />
|
||||
</directory>
|
||||
<directory name="lib">
|
||||
<xi:include href="lib/directory.xml" />
|
||||
</directory>
|
||||
<directory name="server">
|
||||
<xi:include href="server/os2srv.xml" />
|
||||
</directory>
|
||||
</group>
|
50
os2/dirstruct.txt
Normal file
50
os2/dirstruct.txt
Normal file
@@ -0,0 +1,50 @@
|
||||
Win32 and os2ss sight to the system partition
|
||||
+C < contains under os2ss a autogenerated config.sys
|
||||
|
|
||||
+-ROS
|
||||
+-NATIVE < NTDLL, ntoskrnl, hal.dll, csrss.exe os2.exe psx.exe ...
|
||||
| +-DRIVERS < *.SYS
|
||||
| +-CONFIG < registry
|
||||
+-WIN32
|
||||
| +-SYSTEM < user32.dll kernel32.dll ...
|
||||
| +-FONTS
|
||||
| +...
|
||||
+-OS2
|
||||
| +-DLL < doscalls.dll ....
|
||||
| +-SYSTEM
|
||||
| +-...
|
||||
+-PSX
|
||||
+-etc < mountpoint for posix apps
|
||||
+-bin
|
||||
+-dev
|
||||
+-lib < posix.dll
|
||||
+-tmp
|
||||
+-var
|
||||
+-mnt < empty
|
||||
|
||||
posix sight to the system partition
|
||||
/
|
||||
+-etc < mountpoint for posix apps
|
||||
+-bin
|
||||
+-dev < link to OB-mans Devices
|
||||
+-lib < posix.dll
|
||||
+-tmp < alias to systemtemp
|
||||
+-var
|
||||
+-mnt
|
||||
+-C < win32-driveletters
|
||||
| |
|
||||
| +-ROS
|
||||
| +-NATIVE < NTDLL, ntoskrnl, hal.dll, csrss.exe os2.exe psx.exe ...
|
||||
| | +-DRIVERS < *.SYS
|
||||
| | +-CONFIG < registry
|
||||
| +-WIN32
|
||||
| | +-SYSTEM < user32.dll kernel32.dll ...
|
||||
| | +-FONTS
|
||||
| | +...
|
||||
| +-OS2 <some apps
|
||||
| | +-DLL < doscalls.dll ....
|
||||
| | +-SYSTEM
|
||||
| | +-...
|
||||
| +-PSX < empty
|
||||
+-D
|
||||
+-E...
|
16
os2/doc/how to start.txt
Normal file
16
os2/doc/how to start.txt
Normal file
@@ -0,0 +1,16 @@
|
||||
Beginning ROS/2-Developement
|
||||
============================
|
||||
|
||||
ROS/2-Developement means building the OS/2 subsystem for ReactOS. In order to start the developement you should have CVS-access. For the CVS-access see the reactos-Homepage.
|
||||
|
||||
Setting up a build environment
|
||||
------------------------------
|
||||
For the native components (OS2SS.EXE and OS2.EXE) you'll need the same compiler and tools as you need for the rest of ReactOS. If you haven't already set it up, go to the reactos home and see the description there. For now this is the only compiler you need. At some point you'll need a compiler that can generate LX-EXEs. But now also the core dlls and even programs are compiled as PE-win32.
|
||||
|
||||
Getting documentation
|
||||
---------------------
|
||||
I'm not the inventor of OS/2. IBM still did the work, and they did also good work in terms of documentation. If you plan to do core-dll work, you'll also need NT-Native-API documentation. There exists a book called "The Native API", but there should be a preliminary PDF-file floating around. OS/2-API documentation is available on the CDs belonging to your OS/2-compiler. If you develope under OS/2 you have an INF-viewer on board. If your developementsystem is NT, I recomend you OVIEW (http://hobbes.nmsu.edu/pub/windows/win_inf.zip). This two 'books' should be, what you need.
|
||||
|
||||
Contacting me
|
||||
-------------
|
||||
Bevore you start, have a talk with me. We don't want to do useless work or do work twice. So write to ros2@dantepark.de
|
67
os2/doc/index.html
Normal file
67
os2/doc/index.html
Normal file
@@ -0,0 +1,67 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>OS/2 subsystem for ReactOS</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
</head>
|
||||
|
||||
<body bgcolor="#FFFFFF" text="#000000">
|
||||
<h1><b>OS/2 subsystem for ReactOS (ROS/2)</b></h1>
|
||||
<h2><font color="#009966">Introduction</font></h2>
|
||||
<p>The OS/2 subsystem is being developed to enable NT-like systems (like WinNT
|
||||
and ReactOS) to run 32-Bit OS/2 applications natively. With this it shall provide
|
||||
binary compatiblility on x86-Based systems. It is intended to port the ROS/2
|
||||
also to other platforms supported by ReactOS / NT. It is planned to provide
|
||||
source code compatibility on these platforms. Yeeahh, OS/2 for PowerPC is in
|
||||
sight.</p>
|
||||
<h2><font color="#009966">Components</font></h2>
|
||||
<p>ROS/2 consists of the following components:</p>
|
||||
<ul>
|
||||
<li>OS2SS.EXE - A native application that implements the personality of the
|
||||
OS/2 kernel.</li>
|
||||
<li>OS2.EXE - A win32 application that does the interaction of the OS/2 apps
|
||||
with the desktop.</li>
|
||||
<li>Core DLLs - These DLLs that make OS/2 programs interface with the kernel/sub
|
||||
system (i.E. DOSCALLS.DLL). </li>
|
||||
<li>Additional DLLs - DLLs that provide additional APIs for OS/2 apps. This
|
||||
includes Presentation Manager.</li>
|
||||
</ul>
|
||||
<h2><font color="#009966">Current state</font></h2>
|
||||
<p>Up to now just a fragment of DOSCALLS.DLL exists. The biggest problem are the
|
||||
os2 API headers which are (C) by IBM. So help is still welcome.</p>
|
||||
<h2><font color="#009966">16-Bit issues</font></h2>
|
||||
<p>It is not intended to support 16-bit OS/2 applications. This would make the
|
||||
system inconsistent and produce much more work that use. But there is still
|
||||
one issue: Current textmode applications are either 16-bit or use thunking to
|
||||
call the 16-bit APIs. These 32-Bit thunking applications have to be supported.
|
||||
We are still thinking how to accomplish that. </p>
|
||||
<h2><font color="#009966">32-Bit issues</font></h2>
|
||||
<p>It is planned to replace the current MOU- KBD- MSG- and VIO- subsystems with
|
||||
the <a href="http://homepages.tesco.net/%7EJ.deBoynePollard/Softwares/conapi.html">Unicode
|
||||
Console API</a>. This is also the foundation for other platforms we want to
|
||||
provide source code compatibility with. So nearly every 32-Bit processor can
|
||||
be supported. It sould even be possible to implement a 64-bit OS/2 API.</p>
|
||||
<h2><font color="#009966">Architecture</font></h2>
|
||||
<p>To understand the architecture of ReactOS or WinNT read a book from the "Inside
|
||||
Windows NT"-series. The architecture of ROS/2 is like every normal subsystem.
|
||||
When OS2SS.EXE starts, it creates an object directory named os2 and therein
|
||||
it creates a port object with the name Os2API. A port is something like a socket.
|
||||
Two programs can comunicate with each other via a port. The port Os2API provides
|
||||
the LPC API of the OS2SS.EXE - the actual subsystem. <br>
|
||||
Every OS/2 program that is loaded, is linked with DOSCALLS.DLL and NTDLL.DLL
|
||||
- the interface to the NT-kernel. Since DOSCALLS is implemented using NTDLL.DLL,
|
||||
every OS/2 app has it in its adress space. Many functions in DOSCALLS.DLL are
|
||||
implemented by just wrapping NTDLL.DLL functions. Some functions however need
|
||||
assistance by the subsystem. For this reason the app makes an LPC to OS2SS.EXE.
|
||||
LPC means local procedure call and it is a very fast version of RPC. Together
|
||||
with the first application also OS2.EXE starts up. OS2.EXE runs in the win32
|
||||
subsystem with the security of the current user. OS2.EXE is used to gather keyboard
|
||||
and mouse input and to show console windows and PM-windows of all OS/2 programms
|
||||
of the current user. In order to accomplish this OS2.EXE creates a port object
|
||||
in the os2 object directory named Os2Interact. OS/2 applications have a connection
|
||||
to OS2.EXE, too. OS2SS.EXE and OS2.EXE also talk to each other. An OS/2 application
|
||||
then makes LPCs either to OS2.EXE directly or if required via OS2SS.EXE.</p>
|
||||
<p>Details</p>
|
||||
<p> </p>
|
||||
<p>LPC Documentation</p>
|
||||
</body>
|
||||
</html>
|
12603
os2/include/os2.h
Normal file
12603
os2/include/os2.h
Normal file
File diff suppressed because it is too large
Load Diff
91
os2/include/ros2.h
Normal file
91
os2/include/ros2.h
Normal file
@@ -0,0 +1,91 @@
|
||||
/* $ $
|
||||
*/
|
||||
/*
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS OS/2 sub system
|
||||
* FILE: dll/doscalls.c
|
||||
* PURPOSE: supportheader for Kernelservices.
|
||||
* Use this file if your dll or application
|
||||
* is going to use both, the os2 base services
|
||||
* as well as the native API of NTDLL.DLL
|
||||
* PROGRAMMER: Robert K. nonvolatil@yahoo.de
|
||||
* REVISION HISTORY:
|
||||
* 1-08-2002 Created
|
||||
*/
|
||||
|
||||
/* How to use:
|
||||
History got us another time. If you want to write a module
|
||||
that uses either native-api or os2-services...no problem.
|
||||
But if you want to use both of them you run into type conflicts.
|
||||
BOOL is not very surprising. But there are many other types
|
||||
whose names are equal. This results from the fact that NT
|
||||
should originally become OS/2 3.0.
|
||||
So your solution lies in including this file instead of os2.h
|
||||
and ntddk.h. What this file here does is, it puts the os2-types+
|
||||
functions into the namespace OS2 while the nt-types+functions are
|
||||
put into the namespace NT. The still conflicting #defines are handled
|
||||
like this: If ntddk.h defintes a symbol FOO and os2.h does the same,
|
||||
this file here undefines the ntddk.h-one and renames it to NT_FOO.
|
||||
This is only done for conflicting symbols. Of course, this list is a
|
||||
source for errors. But is there a better solution than renaming
|
||||
all of the symbols?
|
||||
*/
|
||||
|
||||
#ifndef __ROS2_H__
|
||||
#define __ROS2_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
namespace NT
|
||||
{
|
||||
#include <ddk/ntddk.h>
|
||||
#include <napi/types.h>
|
||||
}
|
||||
|
||||
|
||||
/* rename all the symbols */
|
||||
#define NT_FILE_CREATE FILE_CREATE
|
||||
#undef FILE_CREATE
|
||||
#define NT_CREATE_SUSPENDED CREATE_SUSPENDED
|
||||
#undef CREATE_SUSPENDED
|
||||
|
||||
namespace OS2
|
||||
{
|
||||
#include "os2.h"
|
||||
}
|
||||
|
||||
using namespace OS2;
|
||||
|
||||
APIRET STDCALL Dos32Open(PSZ pszFileName, PHFILE pHf,
|
||||
PULONG pulAction, ULONG cbFile,
|
||||
ULONG ulAttribute, ULONG fsOpenFlags,
|
||||
ULONG fsOpenMode, PVOID reserved ); //ULONGPEAOP2 peaop2)
|
||||
APIRET STDCALL Dos32Close(HFILE hFile);
|
||||
APIRET STDCALL Dos32Read(HFILE hFile, PVOID pBuffer,
|
||||
ULONG cbRead, PULONG pcbActual);
|
||||
APIRET STDCALL Dos32Write(HFILE hFile, PVOID pBuffer,
|
||||
ULONG cbWrite, PULONG pcbActual);
|
||||
ULONG STDCALL DosSleep (ULONG ulInterval);
|
||||
ULONG STDCALL DosBeep (ULONG ulFrequency, ULONG ulDuration);
|
||||
VOID STDCALL DosExit (ULONG ulAction, ULONG ulResult);
|
||||
|
||||
//ULONG STDCALL DosDevIOCtl (HFILE hDevice, ULONG ulCategory, ULONG ulFunction,
|
||||
// PVOID pParams, ULONG ulParamsLengthMax, PULONG pulParamsLength,
|
||||
// PVOID pData, ULONG ulDataLengthMax, PULONG pulDataLength);
|
||||
|
||||
typedef ULONG foo_TID;
|
||||
typedef foo_TID* foo_PTID;
|
||||
typedef void (*foo_PFNTHREAD)(ULONG ulThreadArg);
|
||||
|
||||
ULONG STDCALL DosCreateThread (foo_PTID ptidThreadID, foo_PFNTHREAD pfnThreadAddr,
|
||||
ULONG ulThreadArg, ULONG ulFlags, ULONG ulStackSize);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __ROS2_H__ */
|
20
os2/install.bat
Normal file
20
os2/install.bat
Normal file
@@ -0,0 +1,20 @@
|
||||
@echo off
|
||||
if "%1" == "" goto NoParameter
|
||||
set ROS_INSTALL=%1
|
||||
goto Install
|
||||
:NoParameter
|
||||
set ROS_INSTALL=c:\reactos
|
||||
:Install
|
||||
echo Installing to %ROS_INSTALL%
|
||||
@echo off
|
||||
|
||||
md %ROS_INSTALL%
|
||||
md %ROS_INSTALL%\bin
|
||||
md %ROS_INSTALL%\symbols
|
||||
md %ROS_INSTALL%\system32
|
||||
|
||||
copy ..\os2\apps\bepslep\bepslep.exe %ROS_INSTALL%\bin
|
||||
copy ..\os2\lib\doscalls\doscalls.dll %ROS_INSTALL%\system32
|
||||
copy ..\os2\lib\doscalls\doscalls.sym %ROS_INSTALL%\symbols
|
||||
copy ..\os2\server\os2ss.exe %ROS_INSTALL%\system32
|
||||
copy ..\os2\server\os2ss.sym %ROS_INSTALL%\symbols
|
5
os2/lib/directory.xml
Normal file
5
os2/lib/directory.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<group>
|
||||
<directory name="doscalls">
|
||||
<xi:include href="doscalls/doscalls.xml" />
|
||||
</directory>
|
||||
</group>
|
65
os2/lib/doscalls/devices/devices.cpp
Normal file
65
os2/lib/doscalls/devices/devices.cpp
Normal file
@@ -0,0 +1,65 @@
|
||||
/* $Id$
|
||||
*/
|
||||
/*
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS OS/2 sub system
|
||||
* PART: doscalls.dll
|
||||
* FILE: devices.cpp
|
||||
* CONTAINS: device io ctl main function.
|
||||
* PURPOSE: Kernelservices for OS/2 apps
|
||||
* PROGRAMMER: Robert K. nonvolatil@yahoo.de
|
||||
* REVISION HISTORY:
|
||||
* 13-03-2002 Created
|
||||
* 25-07-2002 Work to make it compile
|
||||
* 10-11-2002 Done som little things
|
||||
*/
|
||||
|
||||
#define INCL_DOSDEVICES
|
||||
#define INCL_DOSERRORS
|
||||
#include "ros2.h"
|
||||
|
||||
|
||||
/*******************************************/
|
||||
/* DosDevIOCtl performs control functions */
|
||||
/* on a device specified by an opened */
|
||||
/* device handle. */
|
||||
/*******************************************/
|
||||
/*HFILE hDevice; Device handle returned by DosOpen, or a standard (open) device handle. */
|
||||
/*ULONG category; Device category. */
|
||||
/*ULONG function; Device-specific function code. */
|
||||
/*PVOID pParams; Address of the command-specific argument list. */
|
||||
/*ULONG cbParmLenMax; Length, in bytes, of pParams. */
|
||||
/*PULONG pcbParmLen; Pointer to the length of parameters. */
|
||||
/*PVOID pData; Address of the data area. */
|
||||
/*ULONG cbDataLenMax; Length, in bytes, of pData. */
|
||||
/*PULONG pcbDataLen; Pointer to the length of data. */
|
||||
/*APIRET ulrc; Return Code.
|
||||
|
||||
ulrc (APIRET) - returns
|
||||
Return Code.
|
||||
|
||||
DosDevIOCtl returns one of the following values:
|
||||
|
||||
0 NO_ERROR
|
||||
1 ERROR_INVALID_FUNCTION
|
||||
6 ERROR_INVALID_HANDLE
|
||||
15 ERROR_INVALID_DRIVE
|
||||
31 ERROR_GEN_FAILURE
|
||||
87 ERROR_INVALID_PARAMETER
|
||||
111 ERROR_BUFFER_OVERFLOW
|
||||
115 ERROR_PROTECTION_VIOLATION
|
||||
117 ERROR_INVALID_CATEGORY
|
||||
119 ERROR_BAD_DRIVER_LEVEL
|
||||
163 ERROR_UNCERTAIN_MEDIA
|
||||
165 ERROR_MONITORS_NOT_SUPPORTED
|
||||
|
||||
*/
|
||||
APIRET STDCALL DosDevIOCtl(HFILE hDevice, ULONG category, ULONG function,
|
||||
PVOID pParams,ULONG cbParmLenMax,PULONG pcbParmLen,
|
||||
PVOID pData,ULONG cbDataLenMax,PULONG pcbDataLen)
|
||||
{
|
||||
return ERROR_CALL_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* EOF */
|
97
os2/lib/doscalls/devices/ioctl_async.cpp
Normal file
97
os2/lib/doscalls/devices/ioctl_async.cpp
Normal file
@@ -0,0 +1,97 @@
|
||||
/* $Id: ioctl_async.cpp,v 1.2 2004/01/31 01:29:11 robertk Exp $
|
||||
*/
|
||||
/*
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS OS/2 sub system
|
||||
* PART: doscalls.dll
|
||||
* FILE: ipctl_async.cpp
|
||||
* PURPOSE: This file is to be directly included into devices.cpp
|
||||
* CONTAINS: implementation of the category 1 (async I/O)
|
||||
* ioctl functioncodes.
|
||||
* PROGRAMMER: Robert K. nonvolatil@yahoo.de
|
||||
* REVISION HISTORY:
|
||||
* 10-11-2002 Created
|
||||
*/
|
||||
|
||||
|
||||
/* This function implements the async ioctls. It
|
||||
is called from the real DosIOCtl function. This
|
||||
function implies that it is only called, if the
|
||||
cathegory was 0x01.
|
||||
All other parameters are the same as DosIoCtl.
|
||||
|
||||
FIXME: implement me
|
||||
*/
|
||||
APIRET EvaluateAsyncIoCtl( HFILE hDevice, ULONG function,
|
||||
PVOID pParams, ULONG cbParmLenMax, PULONG pcbParmLen,
|
||||
PVOID pData, ULONG cbDataLenMax, PULONG pcbDataLen)
|
||||
{
|
||||
switch( function )
|
||||
{
|
||||
case 0x41: //ASYNC_SETBAUDRATE
|
||||
//+------------------------------------+
|
||||
//|Field Length C Datatype |
|
||||
//|------------------------------------|
|
||||
//|Bit Rate WORD USHORT |
|
||||
//+------------------------------------+
|
||||
break;
|
||||
|
||||
case 0x42: // Set Line Characteristics (stop, parity, data bits)
|
||||
return ERROR_INVALID_PARAMETER; // example
|
||||
break;
|
||||
case 0x43: // Extended Set Bit Rate .
|
||||
break;
|
||||
case 0x44: // Transmit Byte Immediate .
|
||||
break;
|
||||
case 0x45: // Set Break OFF .
|
||||
break;
|
||||
case 0x46: // Set Modem Control Signals .
|
||||
break;
|
||||
case 0x47: // Behave as if XOFF Received (stop transmit) .
|
||||
break;
|
||||
case 0x48: // Behave as if XON Received (start transmit) .
|
||||
break;
|
||||
case 0x49: // Reserved .
|
||||
break;
|
||||
case 0x53: // Set Device Control Block (DCB) Parameters .
|
||||
break;
|
||||
case 0x54: // Set Enhanced Mode Parameters .
|
||||
break;
|
||||
case 0x61: // Query Current Bit Rate .
|
||||
break;
|
||||
case 0x62: // Query Line Characteristics .
|
||||
break;
|
||||
case 0x63: // Extended Query Bit Rate .
|
||||
break;
|
||||
case 0x64: // Query COM Status .
|
||||
break;
|
||||
case 0x65: // Query Transmit Data Status .
|
||||
break;
|
||||
case 0x66: // Query Modem Control Output Signals .
|
||||
break;
|
||||
case 0x67: // Query Current Modem Input Signals .
|
||||
break;
|
||||
case 0x68: // Query Number of Characters in Receive Queue .
|
||||
break;
|
||||
case 0x69: // Query Number of Characters in Transmit Queue .
|
||||
break;
|
||||
case 0x72: // Query COM Event Information .
|
||||
break;
|
||||
case 0x73: // Query Device Control Block (DCB) Parameters .
|
||||
break;
|
||||
case 0x74: // Query Enhanced Mode Parameters .
|
||||
break;
|
||||
default:
|
||||
return ERROR_INVALID_FUNCTION;
|
||||
break;
|
||||
}
|
||||
return ERROR_INVALID_FUNCTION;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* EOF */
|
35
os2/lib/doscalls/doscalls.def
Normal file
35
os2/lib/doscalls/doscalls.def
Normal file
@@ -0,0 +1,35 @@
|
||||
; $Id: doscalls.def,v 1.6 2004/01/31 01:29:11 robertk Exp $
|
||||
;
|
||||
; Def for doscalls.dll - part of the OS/2-sub system
|
||||
; for ReactOS. Provides Access to OS/2 kernel services.
|
||||
|
||||
LIBRARY doscalls.dll
|
||||
|
||||
DESCRIPTION "Part of the ReactOS OS/2 sub system, provides base kernel services to OS/2-apps"
|
||||
|
||||
EXPORTS
|
||||
; FIXME: fill in all exports
|
||||
|
||||
<<<<<<< doscalls.def
|
||||
DosSleep
|
||||
DosClose
|
||||
DosOpen
|
||||
DosRead
|
||||
DosWrite
|
||||
DosDevIOCtl
|
||||
DosBeep
|
||||
DosExit
|
||||
DosCreateThread
|
||||
=======
|
||||
DosSleep
|
||||
Dos32Close
|
||||
Dos32Open
|
||||
Dos32Read
|
||||
Dos32Write
|
||||
;DosDevIOCtl
|
||||
DosBeep
|
||||
DosExit
|
||||
DosCreateThread
|
||||
>>>>>>> 1.5
|
||||
|
||||
; EOF
|
23
os2/lib/doscalls/doscalls.def.bak
Normal file
23
os2/lib/doscalls/doscalls.def.bak
Normal file
@@ -0,0 +1,23 @@
|
||||
; $Id: doscalls.def.bak,v 1.1 2002/09/04 22:19:47 robertk Exp $
|
||||
;
|
||||
; Def for doscalls.dll - part of the OS/2-sub system
|
||||
; for ReactOS. Provides Access to OS/2 kernel services.
|
||||
|
||||
LIBRARY doscalls.dll
|
||||
|
||||
DESCRIPTION "Part of the ReactOS OS/2 sub system, provides base kernel services to OS/2-apps"
|
||||
|
||||
EXPORTS
|
||||
; FIXME: fill in all exports
|
||||
|
||||
Dos32Sleep@4 @229
|
||||
Dos32Close@4 @257
|
||||
Dos32Open@32 @273
|
||||
Dos32Read@16 @281
|
||||
Dos32Write@16 @282
|
||||
Dos32DevIOCtl@36 @284
|
||||
Dos32Beep@8 @286
|
||||
Dos32Exit@8 @234
|
||||
Dos32CreateThread@20 @311
|
||||
|
||||
; EOF
|
35
os2/lib/doscalls/doscalls.edf
Normal file
35
os2/lib/doscalls/doscalls.edf
Normal file
@@ -0,0 +1,35 @@
|
||||
; $Id: doscalls.edf,v 1.4 2004/01/31 01:29:11 robertk Exp $
|
||||
;
|
||||
; Def for doscalls.dll - part of the OS/2-sub system
|
||||
; for ReactOS. Provides Access to OS/2 kernel services.
|
||||
|
||||
LIBRARY doscalls.dll
|
||||
|
||||
DESCRIPTION "Part of the ReactOS OS/2 sub system, provides base kernel services to OS/2-apps"
|
||||
|
||||
EXPORTS
|
||||
; FIXME: fill in all exports
|
||||
|
||||
<<<<<<< doscalls.edf
|
||||
DosSleep=DosSleep
|
||||
DosClose=DosClose
|
||||
DosOpen=DosOpen
|
||||
DosRead=DosRead
|
||||
DosWrite=DosWrite
|
||||
DosDevIOCtl=DosDevIOCtl
|
||||
DosBeep=DosBeep
|
||||
DosExit=DosExit
|
||||
DosCreateThread=DosCreateThread
|
||||
=======
|
||||
DosSleep=DosSleep@4 @229
|
||||
Dos32Close=Dos32Close@4 @257
|
||||
Dos32Open=Dos32Open@32 @273
|
||||
Dos32Read=Dos32Read@16 @281
|
||||
Dos32Write=Dos32Write@16 @282
|
||||
;DosDevIOCtl=DosDevIOCtl@36 @284
|
||||
DosBeep=DosBeep@8 @286
|
||||
DosExit=DosExit@8 @234
|
||||
DosCreateThread=DosCreateThread@20 @311
|
||||
>>>>>>> 1.3
|
||||
|
||||
; EOF
|
4
os2/lib/doscalls/doscalls.rc
Normal file
4
os2/lib/doscalls/doscalls.rc
Normal file
@@ -0,0 +1,4 @@
|
||||
#define REACTOS_STR_FILE_DESCRIPTION "ReactOS-OS/2 subsystem base services\0"
|
||||
#define REACTOS_STR_INTERNAL_NAME "doscalls\0"
|
||||
#define REACTOS_STR_ORIGINAL_FILENAME "doscalls.dll\0"
|
||||
#include <reactos/version.rc>
|
23
os2/lib/doscalls/doscalls.xml
Normal file
23
os2/lib/doscalls/doscalls.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<module name="doscalls" type="nativedll">
|
||||
<importlibrary definition="doscalls.def" />
|
||||
<include base="doscalls">../../include</include>
|
||||
<linkerflag>-lgcc</linkerflag>
|
||||
<directory name="devices">
|
||||
<file>devices.cpp</file>
|
||||
<file>ioctl_async.cpp</file>
|
||||
</directory>
|
||||
<directory name="file">
|
||||
<file>directory.cpp</file>
|
||||
<file>openclose.cpp</file>
|
||||
</directory>
|
||||
<directory name="memory">
|
||||
<file>memory.cpp</file>
|
||||
</directory>
|
||||
<directory name="misc">
|
||||
<file>doscalls.cpp</file>
|
||||
<file>error.cpp</file>
|
||||
</directory>
|
||||
<directory name="run">
|
||||
<file>process.cpp</file>
|
||||
</directory>
|
||||
</module>
|
179
os2/lib/doscalls/file/directory.cpp
Normal file
179
os2/lib/doscalls/file/directory.cpp
Normal file
@@ -0,0 +1,179 @@
|
||||
/* $Id$
|
||||
*/
|
||||
/*
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS OS/2 sub system
|
||||
* PART: doscalls.dll
|
||||
* FILE: directory.cpp
|
||||
* PURPOSE: Kernelservices for OS/2 apps
|
||||
* CONTAINS: Directory related CP-functions.
|
||||
* PROGRAMMER: Robert K. nonvolatil@yahoo.de
|
||||
* REVISION HISTORY:
|
||||
* 10-11-2002 Created
|
||||
*/
|
||||
|
||||
|
||||
#define INCL_DOSFILEMGR
|
||||
#define INCL_DOSERRORS
|
||||
#include "ros2.h"
|
||||
|
||||
|
||||
|
||||
|
||||
/******************************************
|
||||
DosDelete removes a file name from a
|
||||
directory. The deleted file may be
|
||||
recoverable.
|
||||
|
||||
pszFile (PSZ) - input
|
||||
Address of the name of the file to be deleted.
|
||||
|
||||
ulrc (APIRET) - returns
|
||||
Return Code.
|
||||
|
||||
DosDelete returns one of the following values:
|
||||
0 NO_ERROR
|
||||
2 ERROR_FILE_NOT_FOUND
|
||||
3 ERROR_PATH_NOT_FOUND
|
||||
5 ERROR_ACCESS_DENIED
|
||||
26 ERROR_NOT_DOS_DISK
|
||||
32 ERROR_SHARING_VIOLATION
|
||||
36 ERROR_SHARING_BUFFER_EXCEEDED
|
||||
87 ERROR_INVALID_PARAMETER
|
||||
206 ERROR_FILENAME_EXCED_RANGE
|
||||
*******************************************/
|
||||
APIRET DosDelete(PSZ pszFile)
|
||||
{
|
||||
return ERROR_CALL_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
/******************************************
|
||||
DosDeleteDir removes a subdirectory
|
||||
from the specified disk.
|
||||
|
||||
pszDir (PSZ) - input
|
||||
Address of the fully qualified path name of the subdirectory to be removed.
|
||||
|
||||
ulrc (APIRET) - returns
|
||||
Return Code.
|
||||
|
||||
DosDeleteDir returns one of the following values:
|
||||
|
||||
0 NO_ERROR
|
||||
2 ERROR_FILE_NOT_FOUND
|
||||
3 ERROR_PATH_NOT_FOUND
|
||||
5 ERROR_ACCESS_DENIED
|
||||
16 ERROR_CURRENT_DIRECTORY
|
||||
26 ERROR_NOT_DOS_DISK
|
||||
87 ERROR_INVALID_PARAMETER
|
||||
108 ERROR_DRIVE_LOCKED
|
||||
206 ERROR_FILENAME_EXCED_RANGE
|
||||
******************************************/
|
||||
APIRET DosDeleteDir(PSZ pszDir)
|
||||
{
|
||||
return ERROR_CALL_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*******************************************
|
||||
DosCopy copies the source file or
|
||||
subdirectory to the destination file or
|
||||
subdirectory.
|
||||
|
||||
pszOld (PSZ) - input
|
||||
Address of the ASCIIZ path name of the source file,
|
||||
subdirectory, or character device.
|
||||
|
||||
Global file-name characters are not allowed.
|
||||
|
||||
pszNew (PSZ) - input
|
||||
Address of the ASCIIZ path name of the target file,
|
||||
subdirectory, or character device.
|
||||
|
||||
Global file-name characters are not allowed.
|
||||
|
||||
option (ULONG) - input
|
||||
ULONG bit flags that define how the DosCopy
|
||||
function is done.
|
||||
|
||||
|
||||
Bit Description
|
||||
|
||||
31-3 Reserved. These bits must be set to
|
||||
zero.
|
||||
|
||||
2 DCPY_FAILEAS (0x00000004)
|
||||
Discard the EAs if the source file
|
||||
contains EAs and the destination file
|
||||
system does not support EAs.
|
||||
|
||||
0 Discard the EAs (extended attributes) if
|
||||
the destination file system does not
|
||||
support EAs.
|
||||
|
||||
1 Fail the copy if the destination file
|
||||
system does not support EAs.
|
||||
|
||||
1 DCPY_APPEND (x00000002)
|
||||
Append the source file to the target
|
||||
file's end of data.
|
||||
|
||||
0 Replace the target file with the source
|
||||
file.
|
||||
1 Append the source file to the target file's
|
||||
end of data.
|
||||
|
||||
This is ignored when copying a
|
||||
directory, or if the target file does not
|
||||
exist.
|
||||
|
||||
0 DCPY_EXISTING (0x00000001)
|
||||
Existing Target File Disposition.
|
||||
|
||||
0 Do not copy the source file to the target
|
||||
if the file name already exists within the
|
||||
target directory. If a single file is being
|
||||
copied and the target already exists, an
|
||||
error is returned.
|
||||
|
||||
1 Copy the source file to the target even if
|
||||
the file name already exists within the
|
||||
target directory.
|
||||
|
||||
Bit flag DCPY_FAILEAS can be used in
|
||||
combination with bit flag DCPY_APPEND or
|
||||
DCPY_EXISTING.
|
||||
|
||||
ulrc (APIRET) - returns
|
||||
Return Code.
|
||||
|
||||
DosCopy returns one of the following values:
|
||||
|
||||
0 NO_ERROR
|
||||
2 ERROR_FILE_NOT_FOUND
|
||||
3 ERROR_PATH_NOT_FOUND
|
||||
5 ERROR_ACCESS_DENIED
|
||||
26 ERROR_NOT_DOS_DISK
|
||||
32 ERROR_SHARING_VIOLATION
|
||||
36 ERROR_SHARING_BUFFER_EXCEEDED
|
||||
87 ERROR_INVALID_PARAMETER
|
||||
108 ERROR_DRIVE_LOCKED
|
||||
112 ERROR_DISK_FULL
|
||||
206 ERROR_FILENAME_EXCED_RANGE
|
||||
267 ERROR_DIRECTORY
|
||||
282 ERROR_EAS_NOT_SUPPORTED
|
||||
283 ERROR_NEED_EAS_FOUND
|
||||
*******************************************/
|
||||
APIRET DosCopy(PSZ pszOld,PSZ pszNew, ULONG option)
|
||||
{
|
||||
return ERROR_CALL_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* EOF */
|
199
os2/lib/doscalls/file/openclose.cpp
Normal file
199
os2/lib/doscalls/file/openclose.cpp
Normal file
@@ -0,0 +1,199 @@
|
||||
/* $Id$
|
||||
*/
|
||||
/*
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS OS/2 sub system
|
||||
* PART: doscalls.dll
|
||||
* FILE: openclose.cpp
|
||||
* PURPOSE: Kernelservices for OS/2 apps
|
||||
* CONTAINS: Open close write and handle related stuff.
|
||||
* PROGRAMMER: Robert K. nonvolatil@yahoo.de
|
||||
* REVISION HISTORY:
|
||||
* 13-03-2002 Created
|
||||
* 25-07-2002 Work to make it compile
|
||||
*/
|
||||
|
||||
|
||||
#define INCL_DOSFILEMGR
|
||||
#define INCL_DOSERRORS
|
||||
#include "ros2.h"
|
||||
|
||||
|
||||
<<<<<<< openclose.cpp
|
||||
|
||||
APIRET STDCALL DosOpen(PSZ pszFileName, PHFILE pHf,
|
||||
=======
|
||||
APIRET STDCALL Dos32Open(PSZ pszFileName, PHFILE pHf,
|
||||
>>>>>>> 1.4
|
||||
PULONG pulAction, ULONG cbFile,
|
||||
ULONG ulAttribute, ULONG fsOpenFlags,
|
||||
ULONG fsOpenMode, PVOID reserved ) //ULONGPEAOP2 peaop2)
|
||||
{
|
||||
/* NTAPI
|
||||
ZwCreateFile(
|
||||
OUT PHANDLE FileHandle,
|
||||
IN ACCESS_MASK DesiredAccess,
|
||||
IN POBJECT_ATTRIBUTES ObjectAttributes,
|
||||
OUT PIO_STATUS_BLOCK IoStatusBlock,
|
||||
IN PLARGE_INTEGER AllocationSize OPTIONAL,
|
||||
IN ULONG FileAttributes,
|
||||
IN ULONG ShareAccess,
|
||||
IN ULONG CreateDisposition,
|
||||
IN ULONG CreateOptions,
|
||||
IN PVOID EaBuffer OPTIONAL,
|
||||
IN ULONG EaLength
|
||||
);*/
|
||||
|
||||
/*
|
||||
|
||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||
IO_STATUS_BLOCK IoStatusBlock;
|
||||
UNICODE_STRING NtPathU;
|
||||
HANDLE FileHandle;
|
||||
NTSTATUS Status;
|
||||
ULONG Flags = 0;
|
||||
|
||||
switch (dwCreationDisposition)
|
||||
{
|
||||
case CREATE_NEW:
|
||||
dwCreationDisposition = FILE_CREATE;
|
||||
break;
|
||||
|
||||
case CREATE_ALWAYS:
|
||||
dwCreationDisposition = FILE_OVERWRITE_IF;
|
||||
break;
|
||||
|
||||
case OPEN_EXISTING:
|
||||
dwCreationDisposition = FILE_OPEN;
|
||||
break;
|
||||
|
||||
case OPEN_ALWAYS:
|
||||
dwCreationDisposition = OPEN_ALWAYS;
|
||||
break;
|
||||
|
||||
case TRUNCATE_EXISTING:
|
||||
dwCreationDisposition = FILE_OVERWRITE;
|
||||
}
|
||||
|
||||
DPRINT("CreateFileW(lpFileName %S)\n",lpFileName);
|
||||
|
||||
if (dwDesiredAccess & GENERIC_READ)
|
||||
dwDesiredAccess |= FILE_GENERIC_READ;
|
||||
|
||||
if (dwDesiredAccess & GENERIC_WRITE)
|
||||
dwDesiredAccess |= FILE_GENERIC_WRITE;
|
||||
|
||||
if (!(dwFlagsAndAttributes & FILE_FLAG_OVERLAPPED))
|
||||
{
|
||||
Flags |= FILE_SYNCHRONOUS_IO_ALERT;
|
||||
}
|
||||
|
||||
if (!RtlDosPathNameToNtPathName_U ((LPWSTR)lpFileName,
|
||||
&NtPathU,
|
||||
NULL,
|
||||
NULL))
|
||||
return INVALID_HANDLE_VALUE;
|
||||
|
||||
DPRINT("NtPathU \'%S\'\n", NtPathU.Buffer);
|
||||
|
||||
ObjectAttributes.Length = sizeof(OBJECT_ATTRIBUTES);
|
||||
ObjectAttributes.RootDirectory = NULL;
|
||||
ObjectAttributes.ObjectName = &NtPathU;
|
||||
ObjectAttributes.Attributes = OBJ_CASE_INSENSITIVE;
|
||||
ObjectAttributes.SecurityDescriptor = NULL;
|
||||
ObjectAttributes.SecurityQualityOfService = NULL;
|
||||
|
||||
Status = NtCreateFile (&FileHandle,
|
||||
dwDesiredAccess,
|
||||
&ObjectAttributes,
|
||||
&IoStatusBlock,
|
||||
NULL,
|
||||
dwFlagsAndAttributes,
|
||||
dwShareMode,
|
||||
dwCreationDisposition,
|
||||
Flags,
|
||||
NULL,
|
||||
0);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastErrorByStatus (Status);
|
||||
return INVALID_HANDLE_VALUE;
|
||||
}
|
||||
|
||||
return FileHandle;*/
|
||||
|
||||
return ERROR_CALL_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
/* close a Handle. seems finished */
|
||||
APIRET STDCALL DosClose(HFILE hFile)
|
||||
{
|
||||
NT::NTSTATUS nErrCode;
|
||||
nErrCode = NT::ZwClose( (NT::HANDLE)hFile );
|
||||
switch( nErrCode )
|
||||
{
|
||||
/*
|
||||
case STATUS_SUCCESS:
|
||||
return NO_ERROR;
|
||||
case STATUS_INVALID_HANDLE:
|
||||
return ERROR_INVALID_HANDLE;
|
||||
case STATUS_HANDLE_NOT_CLOSABLE:
|
||||
return ERROR_FILE_NOT_FOUND;
|
||||
*/
|
||||
}
|
||||
return nErrCode;
|
||||
}
|
||||
|
||||
|
||||
|
||||
APIRET STDCALL DosRead(HFILE hFile, PVOID pBuffer,
|
||||
ULONG cbRead, PULONG pcbActual)
|
||||
{
|
||||
NT::NTSTATUS nErrCode;
|
||||
NT::IO_STATUS_BLOCK isbStatus;
|
||||
// read data from file
|
||||
nErrCode = NT::ZwReadFile( (NT::HANDLE)hFile, NULL, NULL, NULL,
|
||||
&isbStatus, pBuffer, cbRead,
|
||||
NULL, NULL );
|
||||
// contains the # bytes actually read.
|
||||
*pcbActual = isbStatus.Information;
|
||||
switch(nErrCode)
|
||||
{
|
||||
/*
|
||||
case STATUS_INVALID_HANDLE:
|
||||
return ERROR_INVALID_HANDLE;
|
||||
// FIXME: complete this
|
||||
*/
|
||||
}
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
/* Generic write to a stream given by hFile */
|
||||
APIRET STDCALL DosWrite(HFILE hFile, PVOID pBuffer,
|
||||
ULONG cbWrite, PULONG pcbActual)
|
||||
{
|
||||
NT::NTSTATUS nErrCode;
|
||||
NT::IO_STATUS_BLOCK StatusBlk;
|
||||
nErrCode = NtWriteFile( (NT::HANDLE)hFile, NULL, NULL, NULL,
|
||||
&StatusBlk, pBuffer, cbWrite, 0, NULL );
|
||||
// FIXME *pcbActual = StatusBlk.Information;
|
||||
// do an errorcode translation FIXME: correct
|
||||
return ERROR_CALL_NOT_IMPLEMENTED;
|
||||
switch(nErrCode)
|
||||
{
|
||||
/*
|
||||
case STATUS_SUCCESS:
|
||||
case STATUS_PENDING:
|
||||
case STATUS_ACCESS_DENIED:
|
||||
case STATUS_INVALID_HANDLE:
|
||||
case STATUS_FILE_LOCK_CONFLICT:
|
||||
return 0;
|
||||
*/
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
1063
os2/lib/doscalls/implemented_functions_info.txt
Normal file
1063
os2/lib/doscalls/implemented_functions_info.txt
Normal file
File diff suppressed because it is too large
Load Diff
61
os2/lib/doscalls/makefile
Normal file
61
os2/lib/doscalls/makefile
Normal file
@@ -0,0 +1,61 @@
|
||||
# $Id: makefile,v 1.7 2004/01/31 01:29:11 robertk Exp $
|
||||
|
||||
PATH_TO_TOP = ../../../reactos
|
||||
|
||||
PATH_TO_OS2_TOP = ../..
|
||||
|
||||
TARGET_TYPE = dynlink
|
||||
|
||||
#TARGET_DEFONLY = yes
|
||||
|
||||
TARGET_NAME = doscalls
|
||||
|
||||
TARGET_BASE = 0x68E00000
|
||||
|
||||
TARGET_CPPFLAGS =\
|
||||
-Wall \
|
||||
-I$(PATH_TO_OS2_TOP)/include \
|
||||
-D__DOSCALLSDLL__
|
||||
# removed CFLAGX
|
||||
# -fno-builtin \
|
||||
# -nostdinc \
|
||||
# -nostdlib \
|
||||
|
||||
TARGET_ENTRY = _DllMain@12
|
||||
|
||||
TARGET_LFLAGS = -nostartfiles
|
||||
|
||||
TARGET_LIBS = doscalls.a
|
||||
|
||||
TARGET_SDKLIBS = ntdll.a
|
||||
|
||||
TARGET_GCCLIBS = stdc++
|
||||
|
||||
TARGET_OBJECTS = $(TARGET_NAME).o
|
||||
|
||||
|
||||
MISC_OBJECTS = misc/doscalls.o misc/error.o
|
||||
|
||||
FILE_OBJECTS = file/openclose.o
|
||||
|
||||
RUN_OBJECTS = run/process.o
|
||||
|
||||
DEVICES_OBJECTS = devices/devices.o
|
||||
|
||||
OTHER_OBJECTS =
|
||||
|
||||
SYNC_OBJECTS =
|
||||
|
||||
TARGET_OBJECTS = $(FILE_OBJECTS) $(RUN_OBJECTS) $(DEVICES_OBJECTS) \
|
||||
$(MISC_OBJECTS) $(OTHER_OBJECTS) $(SYNC_OBJECTS)
|
||||
|
||||
#TARGET_CLEAN = file/*.o vio/*.o sync/*.o mem/*.o \
|
||||
# misc/*.o mou/*.o kbd/*.o run/*.o \
|
||||
# doscalls.dll temp.exp
|
||||
|
||||
include $(PATH_TO_TOP)/rules.mak
|
||||
|
||||
include $(TOOLS_PATH)/helper.mk
|
||||
|
||||
|
||||
# EOF
|
40
os2/lib/doscalls/memory/memory.cpp
Normal file
40
os2/lib/doscalls/memory/memory.cpp
Normal file
@@ -0,0 +1,40 @@
|
||||
|
||||
|
||||
|
||||
// TODO: HEader: To be pasted
|
||||
|
||||
|
||||
|
||||
|
||||
// INCL_DOSMEMMGR || !INCL_NOCOMMON
|
||||
#define INCL_DOSMEMMGR
|
||||
#undefine INCL_NOCOMMON
|
||||
|
||||
#include <os2.h>
|
||||
|
||||
|
||||
// TODO: Expain that this is for memory alloc/free funcs of Os2 api
|
||||
|
||||
|
||||
|
||||
// TODO: Implement functions and give them bodies
|
||||
ULONG DosAllocMem (PPVOID pBaseAddress, ULONG ulObjectSize,
|
||||
ULONG ulAllocationFlags);
|
||||
ULONG DosAllocSharedMem (PPVOID pBaseAddress, PCSZ pszName,
|
||||
ULONG ulObjectSize, ULONG ulAllocationFlags);
|
||||
ULONG DosFreeMem (PVOID pBaseAddress);
|
||||
ULONG DosGetNamedSharedMem (PPVOID pBaseAddress, PCSZ pszSharedMemName,
|
||||
ULONG ulAttributeFlags);
|
||||
ULONG DosGetSharedMem (CPVOID pBaseAddress, ULONG ulAttributeFlags);
|
||||
ULONG DosGiveSharedMem (CPVOID pBaseAddress, PID idProcessId,
|
||||
ULONG ulAttributeFlags);
|
||||
ULONG DosQueryMem (CPVOID pBaseAddress, PULONG pulRegionSize,
|
||||
PULONG pulAllocationFlags);
|
||||
ULONG DosSetMem (CPVOID pBaseAddress, ULONG ulRegionSize,
|
||||
ULONG ulAttributeFlags);
|
||||
ULONG DosSubAllocMem (PVOID pOffset, PPVOID pBlockOffset, ULONG ulSize);
|
||||
ULONG DosSubFreeMem (PVOID pOffset, PVOID pBlockOffset, ULONG ulSize);
|
||||
ULONG DosSubSetMem (PVOID pOffset, ULONG ulFlags, ULONG ulSize);
|
||||
ULONG DosSubUnsetMem (PVOID pOffset);
|
||||
|
||||
// TODO: Add file to makefile
|
33
os2/lib/doscalls/misc/doscalls.cpp
Normal file
33
os2/lib/doscalls/misc/doscalls.cpp
Normal file
@@ -0,0 +1,33 @@
|
||||
/* $Id$
|
||||
*/
|
||||
/*
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS OS/2 sub system
|
||||
* FILE: dll/doscalls.c
|
||||
* PURPOSE: Kernelservices for OS/2 apps
|
||||
* PROGRAMMER: Robert K. nonvolatil@yahoo.de
|
||||
* REVISION HISTORY:
|
||||
* 13-03-2002 Created
|
||||
*/
|
||||
|
||||
|
||||
// here's only the NTDLL needet
|
||||
#include <ddk/ntddk.h>
|
||||
|
||||
|
||||
|
||||
|
||||
BOOL STDCALL DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved )
|
||||
{
|
||||
switch (ul_reason_for_call)
|
||||
{
|
||||
case 1://DLL_PROCESS_ATTACH:
|
||||
case 2://DLL_THREAD_ATTACH:
|
||||
case 3://DLL_THREAD_DETACH:
|
||||
case 0://DLL_PROCESS_DETACH:
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
165
os2/lib/doscalls/misc/error.cpp
Normal file
165
os2/lib/doscalls/misc/error.cpp
Normal file
@@ -0,0 +1,165 @@
|
||||
/* $Id$
|
||||
*/
|
||||
/*
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS OS/2 sub system
|
||||
* PART: doscalls.dll
|
||||
* FILE: error.cpp
|
||||
* CONTAINS: Error related CP-functions.
|
||||
* PURPOSE: Kernelservices for OS/2 apps
|
||||
* PROGRAMMER: Robert K. nonvolatil@yahoo.de
|
||||
* REVISION HISTORY:
|
||||
* 13-03-2002 Created
|
||||
* 25-07-2002 Work to make it compile
|
||||
*/
|
||||
|
||||
|
||||
#define INCL_DOSPROCESS
|
||||
#define INCL_DOSERRORS
|
||||
#include "ros2.h"
|
||||
// we need the extra definitions of this file
|
||||
namespace NT {
|
||||
#include <ddk/ntddbeep.h>
|
||||
}
|
||||
|
||||
|
||||
/*******************************************
|
||||
DosBeep generates sound from the
|
||||
speaker.
|
||||
|
||||
freq (ULONG) - input
|
||||
Cycles per second (Hertz) in the range of 0x25 to
|
||||
0x7FFF.
|
||||
|
||||
dur (ULONG) - input
|
||||
The length of the sound in milliseconds.
|
||||
|
||||
ulrc (APIRET) - returns
|
||||
Return Code.
|
||||
|
||||
DosBeep returns one of the following values:
|
||||
|
||||
0 NO_ERROR
|
||||
395 ERROR_INVALID_FREQUENCY
|
||||
*******************************************/
|
||||
APIRET STDCALL DosBeep(ULONG freq, ULONG dur)
|
||||
{
|
||||
NT::BEEP_SET_PARAMETERS BeepSetParameters;
|
||||
NT::HANDLE hBeep;
|
||||
NT::IO_STATUS_BLOCK ComplStatus;
|
||||
NT::UNICODE_STRING unistr;
|
||||
NT::NTSTATUS stat;
|
||||
NT::OBJECT_ATTRIBUTES oa = {sizeof oa, 0, &unistr, NT::OBJ_CASE_INSENSITIVE, 0, 0};
|
||||
|
||||
// init String still bevore use.
|
||||
NT::RtlInitUnicodeString( &unistr, (NT::PWSTR)L"\\\\.\\Beep" );
|
||||
|
||||
if( freq<0x25 || freq>0x7FFF )
|
||||
return ERROR_INVALID_FREQUENCY; //395; //
|
||||
|
||||
/* Set beep data */
|
||||
BeepSetParameters.Frequency = freq;
|
||||
BeepSetParameters.Duration = dur;
|
||||
|
||||
/* open the beep dirver */
|
||||
stat = NT::ZwOpenFile( &hBeep,
|
||||
FILE_READ_DATA | FILE_WRITE_DATA,
|
||||
&oa,
|
||||
&ComplStatus,
|
||||
0, // no sharing
|
||||
FILE_OPEN );
|
||||
|
||||
if ( stat<0 )
|
||||
{
|
||||
return ERROR_NOT_READY;
|
||||
}
|
||||
|
||||
/* actually beep */
|
||||
NT::ZwDeviceIoControlFile(hBeep, 0, // Event
|
||||
0, // APC-routine
|
||||
0, // UserAPCContext
|
||||
&ComplStatus, IOCTL_BEEP_SET,
|
||||
&BeepSetParameters,
|
||||
sizeof(NT::BEEP_SET_PARAMETERS),
|
||||
NULL,
|
||||
0 );
|
||||
NT::ZwClose(hBeep);
|
||||
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
/******************************************
|
||||
DosError disables or enables error
|
||||
notification to end users.
|
||||
|
||||
error (ULONG) - input
|
||||
Error and Exception pop-up flags.
|
||||
|
||||
The unused high-order bits are reserved, and must be zero. The following values can be specified
|
||||
for this parameter. They can be combined using the "logical or" ( | ) operator.
|
||||
|
||||
FERR_DISABLEHARDERR (0x00000000)
|
||||
Disable hard error pop-ups.
|
||||
|
||||
FERR_ENABLEHARDERR (0x00000001)
|
||||
Enable hard error pop-ups.
|
||||
|
||||
FERR_ENABLEEXCEPTION (0x00000000)
|
||||
Enable program exception and untrapped numeric-processor exception pop-ups.
|
||||
|
||||
FERR_DISABLEEXCEPTION (0x00000002)
|
||||
Disable program exception and untrapped numeric-processor exception pop-ups.
|
||||
|
||||
ulrc (APIRET) - returns
|
||||
Return Code.
|
||||
|
||||
DosError returns one of the following values:
|
||||
|
||||
0 NO_ERROR
|
||||
87 ERROR_INVALID_PARAMETER
|
||||
*******************************************/
|
||||
APIRET DosError( ULONG error)
|
||||
{
|
||||
return ERROR_CALL_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************
|
||||
DosMove moves a file object to another
|
||||
location, and changes its name.
|
||||
|
||||
pszOld (PSZ) - input
|
||||
Address of the old path name of the file or
|
||||
subdirectory to be moved.
|
||||
|
||||
pszNew (PSZ) - input
|
||||
Address of the new path name of the file or
|
||||
subdirectory.
|
||||
|
||||
ulrc (APIRET) - returns
|
||||
Return Code.
|
||||
|
||||
DosMove returns the one of following values:
|
||||
|
||||
0 NO_ERROR
|
||||
2 ERROR_FILE_NOT_FOUND
|
||||
3 ERROR_PATH_NOT_FOUND
|
||||
5 ERROR_ACCESS_DENIED
|
||||
17 ERROR_NOT_SAME_DEVICE
|
||||
26 ERROR_NOT_DOS_DISK
|
||||
32 ERROR_SHARING_VIOLATION
|
||||
36 ERROR_SHARING_BUFFER_EXCEEDED
|
||||
87 ERROR_INVALID_PARAMETER
|
||||
108 ERROR_DRIVE_LOCKED
|
||||
206 ERROR_FILENAME_EXCED_RANGE
|
||||
250 ERROR_CIRCULARITY_REQUESTED
|
||||
251 ERROR_DIRECTORY_IN_CDS
|
||||
*******************************************/
|
||||
APIRET DosMove(PSZ pszOld, PSZ pszNew)
|
||||
{
|
||||
return ERROR_CALL_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* EOF */
|
58
os2/lib/doscalls/run/process.cpp
Normal file
58
os2/lib/doscalls/run/process.cpp
Normal file
@@ -0,0 +1,58 @@
|
||||
/* $Id$
|
||||
*/
|
||||
/*
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS OS/2 sub system
|
||||
* PART: doscalls.dll
|
||||
* FILE: process.cpp
|
||||
* CONTAINS: process and thread related CP-functions.
|
||||
* PURPOSE: Kernelservices for OS/2 apps
|
||||
* PROGRAMMER: Robert K. nonvolatil@yahoo.de
|
||||
* REVISION HISTORY:
|
||||
* 13-03-2002 Created
|
||||
* 25-07-2002 Work to make it compile
|
||||
*/
|
||||
|
||||
|
||||
//#if defined (INCL_DOS)
|
||||
#define INCL_DOSPROCESS
|
||||
#define INCL_DOSERRORS
|
||||
#include "ros2.h"
|
||||
|
||||
|
||||
APIRET STDCALL DosSleep(ULONG msec)
|
||||
{
|
||||
NT::NTSTATUS stat;
|
||||
NT::TIME Interv;
|
||||
Interv.QuadPart= -(10000 * msec);
|
||||
stat = NT::NtDelayExecution( TRUE, &Interv );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* $Id$ */
|
||||
/* Terminates the current thread or the current Process.
|
||||
Decission is made by action
|
||||
FIXME: move this code to OS2.EXE */
|
||||
VOID APIENTRY DosExit(ULONG action, ULONG result)
|
||||
{
|
||||
// decide what to do
|
||||
if( action == EXIT_THREAD)
|
||||
{
|
||||
NT::NtTerminateThread( NULL, result );
|
||||
}
|
||||
else // EXIT_PROCESS
|
||||
{
|
||||
NT::NtTerminateProcess( NULL, result );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
APIRET STDCALL DosCreateThread(PTID ptid, PFNTHREAD pfn,
|
||||
ULONG param, ULONG flag, ULONG cbStack)
|
||||
{
|
||||
return ERROR_CALL_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* EOF */
|
14
os2/makefile
Normal file
14
os2/makefile
Normal file
@@ -0,0 +1,14 @@
|
||||
all:
|
||||
@echo To build "os2" there are two paths:
|
||||
@echo ---
|
||||
@echo 1. copy the os2 folder into the reactos\modules folder
|
||||
@echo 2. link reactos/modules/os2 to os2
|
||||
@echo UNIX
|
||||
@echo cd $${ROS_SRC_ROOT}/reactos/modules
|
||||
@echo ln -s $${ROS_SRC_ROOT}/os2 os2
|
||||
@echo WINDOWS
|
||||
@echo cd %%ROS_SRC_ROOT%%\reactos\modules
|
||||
@echo junction os2 %%ROS_SRC_ROOT%%\os2
|
||||
@echo ---
|
||||
@echo Eventually you can run "make depends" in the %%ROS_SRC_ROOT%%\reactos
|
||||
@echo directory to compile it.
|
50
os2/server/dllmain.c
Normal file
50
os2/server/dllmain.c
Normal file
@@ -0,0 +1,50 @@
|
||||
/* $Id$
|
||||
*
|
||||
* dllmain.c - OS/2 Enviroment Subsystem Server
|
||||
*
|
||||
* ReactOS Operating System
|
||||
*
|
||||
* --------------------------------------------------------------------
|
||||
*
|
||||
* This software 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 software 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 software; see the file COPYING.LIB. If not, write
|
||||
* to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
|
||||
* MA 02139, USA.
|
||||
*
|
||||
* --------------------------------------------------------------------
|
||||
*/
|
||||
#include "os2srv.h"
|
||||
|
||||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
/* DLL entry point */
|
||||
|
||||
HANDLE Os2SrvDllHandle = 0;
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
BOOL STDCALL
|
||||
DllMain(HANDLE hDll,
|
||||
DWORD dwReason,
|
||||
LPVOID lpReserved)
|
||||
{
|
||||
if (DLL_PROCESS_ATTACH == dwReason)
|
||||
{
|
||||
Os2SrvDllHandle = hDll;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* EOF */
|
3
os2/server/os2srv.def
Normal file
3
os2/server/os2srv.def
Normal file
@@ -0,0 +1,3 @@
|
||||
LIBRARY os2srv.dll
|
||||
EXPORTS
|
||||
ServerDllInitialization@8
|
13
os2/server/os2srv.h
Normal file
13
os2/server/os2srv.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#ifndef _OS2SS_H_INCLUDED_
|
||||
#define _OS2SS_H_INCLUDED_
|
||||
|
||||
/* PSDK/NDK Headers */
|
||||
#include <stdio.h>
|
||||
#include <windows.h>
|
||||
|
||||
#define NTOS_MODE_USER
|
||||
#include <ndk/ntndk.h>
|
||||
|
||||
#include <csr/server.h>
|
||||
|
||||
#endif /* ndef _OS2SS_H_INCLUDED_ */
|
4
os2/server/os2srv.rc
Normal file
4
os2/server/os2srv.rc
Normal file
@@ -0,0 +1,4 @@
|
||||
#define REACTOS_STR_FILE_DESCRIPTION "ReactOS-OS/2 Environment Subsystem Server\0"
|
||||
#define REACTOS_STR_INTERNAL_NAME "os2srv\0"
|
||||
#define REACTOS_STR_ORIGINAL_FILENAME "os2srv.dll\0"
|
||||
#include <reactos/version.rc>
|
11
os2/server/os2srv.xml
Normal file
11
os2/server/os2srv.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<module name="os2srv" type="nativedll">
|
||||
<importlibrary definition="os2srv.def" />
|
||||
<include base="os2srv">.</include>
|
||||
<define name="__USE_W32API" />
|
||||
<define name="_DISABLE_TIDENTS" />
|
||||
<library>ntdll</library>
|
||||
<library>csrsrv</library>
|
||||
<file>dllmain.c</file>
|
||||
<file>server.c</file>
|
||||
<file>os2srv.rc</file>
|
||||
</module>
|
84
os2/server/server.c
Normal file
84
os2/server/server.c
Normal file
@@ -0,0 +1,84 @@
|
||||
/* $Id$
|
||||
*
|
||||
* server.c - OS/2 Enviroment Subsystem Server - Initialization
|
||||
*
|
||||
* ReactOS Operating System
|
||||
*
|
||||
* --------------------------------------------------------------------
|
||||
*
|
||||
* This software 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 software 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 software; see the file COPYING.LIB. If not, write
|
||||
* to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
|
||||
* MA 02139, USA.
|
||||
*
|
||||
* --------------------------------------------------------------------
|
||||
*/
|
||||
#include "os2srv.h"
|
||||
|
||||
//#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
HANDLE Os2ApiPort = NULL;
|
||||
|
||||
/**********************************************************************
|
||||
* NAME PRIVATE
|
||||
* Os2StaticServerThread/1
|
||||
*/
|
||||
VOID STDCALL Os2StaticServerThread (PVOID x)
|
||||
{
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
PPORT_MESSAGE Request = (PPORT_MESSAGE) x;
|
||||
PPORT_MESSAGE Reply = NULL;
|
||||
ULONG MessageType = 0;
|
||||
|
||||
DPRINT("VMSSRV: %s called\n", __FUNCTION__);
|
||||
|
||||
MessageType = Request->u2.s2.Type;
|
||||
DPRINT("VMSSRV: %s received a message (Type=%d)\n",
|
||||
__FUNCTION__, MessageType);
|
||||
switch (MessageType)
|
||||
{
|
||||
default:
|
||||
Reply = Request;
|
||||
Status = NtReplyPort (Os2ApiPort, Reply);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*=====================================================================
|
||||
* PUBLIC API
|
||||
*===================================================================*/
|
||||
|
||||
NTSTATUS STDCALL ServerDllInitialization (ULONG ArgumentCount,
|
||||
LPWSTR *Argument)
|
||||
{
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
|
||||
DPRINT("VMSSRV: %s called\n", __FUNCTION__);
|
||||
|
||||
// Get the listening port from csrsrv.dll
|
||||
Os2ApiPort = CsrQueryApiPort ();
|
||||
if (NULL == Os2ApiPort)
|
||||
{
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
// Register our message dispatcher
|
||||
Status = CsrAddStaticServerThread (Os2StaticServerThread);
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
//TODO: perform the real OS/2 server internal initialization here
|
||||
}
|
||||
return Status;
|
||||
}
|
||||
|
||||
/* EOF */
|
BIN
os2/utils/LXDUMP.EXE
Normal file
BIN
os2/utils/LXDUMP.EXE
Normal file
Binary file not shown.
65
reactos/CREDITS
Normal file
65
reactos/CREDITS
Normal file
@@ -0,0 +1,65 @@
|
||||
ReactOS is available thanks to the work of:
|
||||
|
||||
Aleksey Bragin <aleksey@studiocerebral.com>
|
||||
Alex Ionescu <ionucu@videotron.ca>
|
||||
Andrew Greenwood <lists@silverblade.co.uk>
|
||||
Arindam Das
|
||||
Art Yerkes <ayerkes@speakeasy.net>
|
||||
Boudewijn Dekker <ariadne@xs4all.nl>
|
||||
Brandon Turner (turnerb7@msu.edu)
|
||||
Brian Palmer <brianp@sginet.com>
|
||||
Casper S. Hornstrup <chorns@users.sourceforge.net>
|
||||
Christoph von Wittich (Christoph@ApiViewer.de)
|
||||
David Welch <welch@cwcom.net>
|
||||
Emanuele Aliberti <ea@iol.it>
|
||||
Eric Kohl <ekohl@rz-online.de>
|
||||
Eugene Ingerman <geneing@myrealbox.com>
|
||||
Filip Navara <xnavara@volny.cz>
|
||||
Frederik Leemans
|
||||
Ge van Geldorp <ge@gse.nl>
|
||||
Ged Murphy <gedmurphy@gmail.com>
|
||||
Guido de Jong
|
||||
Gunnar Andre' Dalsnes <hardon@online.no>
|
||||
Hans Kremer
|
||||
Hartmut Birr <hartmut.birr@gmx.de>
|
||||
Hernan Ochoa
|
||||
Herve Poussineau <hpoussin@reactos.com>
|
||||
Iwan Fatahi <i_fatahi@hotmail.com>
|
||||
James B. Tabor <jimtabor@adsl-64-217-116-74.dsl.hstntx.swbell.net>
|
||||
Jason Eager
|
||||
Jason Filby <jasonfilby@yahoo.com>
|
||||
Jason Weiler
|
||||
Jean Michault
|
||||
Jim Noeth
|
||||
Jonathan Wilson <jonwil@tpgi.com.au>
|
||||
Jurgen van Gael <jurgen.vangael@student.kuleuven.ac.be>
|
||||
KJK::Hyperion <noog@libero.it>
|
||||
Klemens R. Friedl <klemens_friedl@gmx.net>
|
||||
Maarten Bosma <maarten.paul@bosma.de>
|
||||
Magnus Olsen (magnus@greatlord.com)
|
||||
Mark Tempel <mtempel@visi.com>
|
||||
Mark Weaver <mark@npsl.co.uk>
|
||||
Martin Fuchs <martin-fuchs@gmx.net>
|
||||
Marty Dill <mdill@uvic.ca>
|
||||
Matt Pyne
|
||||
Mike Nordell ("tamlin")
|
||||
Nathan Woods <npwoods@mess.org>
|
||||
Paolo Pantaleo <paolopan@freemail.it>
|
||||
Phillip Susi <phreak@iag.net>
|
||||
Rex Jolliff <rex@lvcablemodem.com>
|
||||
Richard Campbell <betam4x@gmail.com>
|
||||
Robert Bergkvist <fragdance@hotmail.com>
|
||||
Robert Dickenson <robd@reactos.org>
|
||||
Royce Mitchell III <royce3@ev1.net>
|
||||
Saveliy Tretiakov <saveliyt@mail.ru>
|
||||
Steven Edwards <steven_ed4153@yahoo.com>
|
||||
Thomas Weidenmueller <w3seek@users.sourceforge.net>
|
||||
Victor Kirhenshtein <sauros@iname.com>
|
||||
Vizzini <vizzini@plasmic.com>
|
||||
|
||||
|
||||
Graphic Design from
|
||||
|
||||
Mindflyer <mf@mufunyo.net>
|
||||
Tango Desktop Project (http://tango-project.org)
|
||||
Everaldo (http://everaldo.com)
|
1148
reactos/Doxyfile
1148
reactos/Doxyfile
File diff suppressed because it is too large
Load Diff
@@ -11,7 +11,7 @@ ReactOS from http://www.reactos.org/.
|
||||
|
||||
To build ReactOS run 'make' (without the quotes) if you are building on Linux
|
||||
or 'mingw32-make' if you are building on Windows (or ReactOS) from the top
|
||||
directory. If you are using RosBE, follow on-screen instructions.
|
||||
directory.
|
||||
|
||||
|
||||
2.2 Building a bootable CD image
|
||||
|
264
reactos/Makefile
264
reactos/Makefile
@@ -38,7 +38,7 @@
|
||||
# This can require several minutes to complete. If you only need to check
|
||||
# dependencies for a single or few modules then you can use the
|
||||
# module_depends targets instead. This target can also repair a damaged or
|
||||
# missing makefile-{ROS_ARCH}.auto if needed.
|
||||
# missing makefile.auto if needed.
|
||||
#
|
||||
# module_depends
|
||||
# These targets do a dependency check of individual modules. Replace module
|
||||
@@ -46,15 +46,9 @@
|
||||
# This is faster than the depends target which does a complete dependency
|
||||
# check of the ReactOS codebase.
|
||||
#
|
||||
# families
|
||||
# A list will be shown with all available build families.
|
||||
#
|
||||
# Accepted environment variables:
|
||||
#
|
||||
# ROS_ARCH
|
||||
# This variable specifies the name of the architecture to build ReactOS for.
|
||||
# The variable defaults to i386.
|
||||
#
|
||||
# ROS_PREFIX
|
||||
# This variable specifies the prefix of the MinGW installation. On Windows
|
||||
# a prefix is usually not needed, but on linux it is usually "mingw32". If
|
||||
@@ -67,18 +61,13 @@
|
||||
# files are generated files that are needed to generate the final
|
||||
# output files. Examples of intermediate files include *.o, *.a, and
|
||||
# *.coff. N.B. Don't put a path separator at the end. The variable
|
||||
# defaults to .\obj-{ROS_ARCH}.
|
||||
# defaults to .\obj-i386.
|
||||
#
|
||||
# ROS_OUTPUT
|
||||
# This variable controls where to put output files. Output files are
|
||||
# generated files that makes up the result of the build process.
|
||||
# Examples of output files include *.exe, *.dll, and *.sys. N.B. Don't
|
||||
# put a path separator at the end. The variable defaults to .\output-{ROS_ARCH}.
|
||||
#
|
||||
# ROS_CDOUTPUT
|
||||
# This variable controls the name of the ReactOS directory on cdrom.
|
||||
# The variable defaults to reactos.
|
||||
# Warning: setting this value may lead to a not bootable/installable cdrom.
|
||||
# put a path separator at the end. The variable defaults to .\output-i386.
|
||||
#
|
||||
# ROS_TEMPORARY
|
||||
# This variable controls where to put temporary files. Temporary files
|
||||
@@ -91,7 +80,7 @@
|
||||
# ROS_INSTALL
|
||||
# This variable controls where to install output files to when using
|
||||
# 'make install'. N.B. Don't put a path separator at the end. The variable
|
||||
# defaults to .\{ROS_CDOUTPUT}.
|
||||
# defaults to .\reactos.
|
||||
#
|
||||
# ROS_BUILDMAP
|
||||
# This variable controls if map files are to be generated for executable
|
||||
@@ -108,12 +97,6 @@
|
||||
# output files) or no (to not build non-symbol-stripped versions of
|
||||
# executable output files). The variable defaults to no.
|
||||
#
|
||||
# ROS_LEAN_AND_MEAN
|
||||
# This variable controls if all binaries should be stripped out of useless
|
||||
# data added by GCC/LD as well as of RSYM symbol data. Output binary size
|
||||
# will go from 80 to 40MB, memory usage from 58 to 38MB and the install CD
|
||||
# from 18 to 13MB. The variable defaults to no.
|
||||
#
|
||||
# ROS_RBUILDFLAGS
|
||||
# Pass parameters to rbuild.
|
||||
# -v Be verbose.
|
||||
@@ -149,12 +132,6 @@ endif
|
||||
.PHONY: world
|
||||
.PHONY: universe
|
||||
|
||||
ifneq ($(ROS_ARCH),)
|
||||
ARCH := $(ROS_ARCH)
|
||||
else
|
||||
ARCH := i386
|
||||
endif
|
||||
|
||||
ifeq ($(ROS_AUTOMAKE),)
|
||||
ROS_AUTOMAKE=makefile.auto
|
||||
endif
|
||||
@@ -169,15 +146,11 @@ ifeq ($(word 1,$(shell gcc -dumpmachine)),mingw32)
|
||||
ifeq ($(findstring msys,$(shell sh --version 2>nul)),msys)
|
||||
export OSTYPE = msys
|
||||
HOST=mingw32-linux
|
||||
HOST_CFLAGS+=-fshort-wchar
|
||||
HOST_CPPFLAGS+=-fshort-wchar
|
||||
else
|
||||
HOST=mingw32-windows
|
||||
endif
|
||||
else
|
||||
HOST=mingw32-linux
|
||||
HOST_CFLAGS+=-fshort-wchar
|
||||
HOST_CPPFLAGS+=-fshort-wchar
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -230,7 +203,6 @@ ifeq ($(HALFVERBOSEECHO),yes)
|
||||
ECHO_REGTESTS=@echo $(QUOTE)[REGTESTS] $@$(QUOTE)
|
||||
ECHO_TEST =@echo $(QUOTE)[TEST] $@$(QUOTE)
|
||||
ECHO_GENDIB =@echo $(QUOTE)[GENDIB] $@$(QUOTE)
|
||||
ECHO_STRIP =@echo $(QUOTE)[STRIP] $@$(QUOTE)
|
||||
else
|
||||
ECHO_CP =
|
||||
ECHO_MKDIR =
|
||||
@@ -259,113 +231,103 @@ else
|
||||
ECHO_REGTESTS=
|
||||
ECHO_TEST =
|
||||
ECHO_GENDIB =
|
||||
ECHO_STRIP =
|
||||
endif
|
||||
|
||||
# Set host compiler/linker
|
||||
ifeq ($(HOST_CC),)
|
||||
HOST_CC = gcc
|
||||
endif
|
||||
ifeq ($(HOST_CPP),)
|
||||
HOST_CPP = g++
|
||||
endif
|
||||
host_gcc = $(Q)$(HOST_CC)
|
||||
host_gpp = $(Q)$(HOST_CPP)
|
||||
|
||||
host_gcc = $(Q)gcc
|
||||
host_gpp = $(Q)g++
|
||||
host_ld = $(Q)ld
|
||||
host_ar = $(Q)ar
|
||||
host_objcopy = $(Q)objcopy
|
||||
|
||||
# Set target compiler/linker
|
||||
ifneq ($(ROS_PREFIX),)
|
||||
PREFIX_ := $(ROS_PREFIX)-
|
||||
else
|
||||
ifeq ($(HOST),mingw32-linux)
|
||||
PREFIX_ := mingw32-
|
||||
else
|
||||
PREFIX_ :=
|
||||
endif
|
||||
endif
|
||||
ifeq ($(TARGET_CC),)
|
||||
TARGET_CC = $(PREFIX_)gcc
|
||||
endif
|
||||
ifeq ($(TARGET_CPP),)
|
||||
TARGET_CPP = $(PREFIX_)g++
|
||||
endif
|
||||
gcc = $(Q)$(TARGET_CC)
|
||||
gpp = $(Q)$(TARGET_CPP)
|
||||
ld = $(Q)$(PREFIX_)ld
|
||||
nm = $(Q)$(PREFIX_)nm
|
||||
objdump = $(Q)$(PREFIX_)objdump
|
||||
ar = $(Q)$(PREFIX_)ar
|
||||
objcopy = $(Q)$(PREFIX_)objcopy
|
||||
dlltool = $(Q)$(PREFIX_)dlltool
|
||||
strip = $(Q)$(PREFIX_)strip
|
||||
windres = $(Q)$(PREFIX_)windres
|
||||
|
||||
# Set utilities
|
||||
ifeq ($(OSTYPE),msys)
|
||||
HOST=mingw32-linux
|
||||
endif
|
||||
ifeq ($(HOST),mingw32-linux)
|
||||
export EXEPREFIX = ./
|
||||
ifeq ($(OSTYPE),msys)
|
||||
export EXEPOSTFIX = .exe
|
||||
else
|
||||
export EXEPOSTFIX =
|
||||
endif
|
||||
ifeq ($(OSTYPE),msys)
|
||||
export EXEPOSTFIX = .exe
|
||||
else
|
||||
export EXEPOSTFIX =
|
||||
endif
|
||||
export SEP = /
|
||||
mkdir = -$(Q)mkdir -p
|
||||
gcc = $(Q)$(PREFIX)-gcc
|
||||
gpp = $(Q)$(PREFIX)-g++
|
||||
ld = $(Q)$(PREFIX)-ld
|
||||
nm = $(Q)$(PREFIX)-nm
|
||||
objdump = $(Q)$(PREFIX)-objdump
|
||||
ar = $(Q)$(PREFIX)-ar
|
||||
objcopy = $(Q)$(PREFIX)-objcopy
|
||||
dlltool = $(Q)$(PREFIX)-dlltool
|
||||
windres = $(Q)$(PREFIX)-windres
|
||||
rm = $(Q)rm -f
|
||||
cp = $(Q)cp
|
||||
NUL = /dev/null
|
||||
else # mingw32-windows
|
||||
ifeq ($(OSTYPE),msys)
|
||||
HOST=mingw32-linux
|
||||
export EXEPREFIX = ./
|
||||
export EXEPOSTFIX = .exe
|
||||
export SEP = /
|
||||
mkdir = -$(Q)mkdir -p
|
||||
gcc = $(Q)gcc
|
||||
gpp = $(Q)g++
|
||||
ld = $(Q)ld
|
||||
nm = $(Q)nm
|
||||
objdump = $(Q)objdump
|
||||
ar = $(Q)ar
|
||||
objcopy = $(Q)objcopy
|
||||
dlltool = $(Q)dlltool
|
||||
windres = $(Q)windres
|
||||
rm = $(Q)rm -f
|
||||
cp = $(Q)cp
|
||||
NUL = /dev/null
|
||||
else
|
||||
export EXEPREFIX =
|
||||
export EXEPOSTFIX = .exe
|
||||
ROS_EMPTY =
|
||||
export SEP = \$(ROS_EMPTY)
|
||||
mkdir = -$(Q)mkdir
|
||||
gcc = $(Q)gcc
|
||||
gpp = $(Q)g++
|
||||
ld = $(Q)ld
|
||||
nm = $(Q)nm
|
||||
objdump = $(Q)objdump
|
||||
ar = $(Q)ar
|
||||
objcopy = $(Q)objcopy
|
||||
dlltool = $(Q)dlltool
|
||||
windres = $(Q)windres
|
||||
rm = $(Q)del /f /q
|
||||
cp = $(Q)copy /y
|
||||
NUL = NUL
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(ROS_INTERMEDIATE),)
|
||||
INTERMEDIATE := $(ROS_INTERMEDIATE)
|
||||
else
|
||||
INTERMEDIATE := obj-$(ARCH)
|
||||
INTERMEDIATE := obj-i386
|
||||
endif
|
||||
INTERMEDIATE_ := $(INTERMEDIATE)$(SEP)
|
||||
|
||||
ifneq ($(ROS_OUTPUT),)
|
||||
OUTPUT := $(ROS_OUTPUT)
|
||||
else
|
||||
OUTPUT := output-$(ARCH)
|
||||
OUTPUT := output-i386
|
||||
endif
|
||||
OUTPUT_ := $(OUTPUT)$(SEP)
|
||||
|
||||
ifneq ($(ROS_CDOUTPUT),)
|
||||
CDOUTPUT := $(ROS_CDOUTPUT)
|
||||
else
|
||||
CDOUTPUT := reactos
|
||||
endif
|
||||
CDOUTPUT_ := $(CDOUTPUT)$(SEP)
|
||||
|
||||
ifneq ($(ROS_TEMPORARY),)
|
||||
TEMPORARY := $(ROS_TEMPORARY)
|
||||
else
|
||||
TEMPORARY := .
|
||||
TEMPORARY :=
|
||||
endif
|
||||
TEMPORARY_ := $(TEMPORARY)$(SEP)
|
||||
|
||||
ifneq ($(ROS_INSTALL),)
|
||||
INSTALL := $(ROS_INSTALL)
|
||||
else
|
||||
INSTALL := $(CDOUTPUT)
|
||||
INSTALL := reactos
|
||||
endif
|
||||
INSTALL_ := $(INSTALL)$(SEP)
|
||||
|
||||
RBUILD_FLAGS := -rReactOS-$(ARCH).rbuild -DARCH=$(ARCH)
|
||||
|
||||
$(INTERMEDIATE):
|
||||
${mkdir} $@
|
||||
|
||||
@@ -377,12 +339,11 @@ endif
|
||||
|
||||
NTOSKRNL_MC = ntoskrnl$(SEP)ntoskrnl.mc
|
||||
KERNEL32_MC = dll$(SEP)win32$(SEP)kernel32$(SEP)kernel32.mc
|
||||
BUILDNO_H = $(INTERMEDIATE_)include$(SEP)reactos$(SEP)buildno.h
|
||||
BUGCODES_H = $(INTERMEDIATE_)include$(SEP)reactos$(SEP)bugcodes.h
|
||||
BUGCODES_RC = $(INTERMEDIATE_)ntoskrnl$(SEP)bugcodes.rc
|
||||
ERRCODES_H = $(INTERMEDIATE_)include$(SEP)reactos$(SEP)errcodes.h
|
||||
ERRCODES_RC = $(INTERMEDIATE_)dll$(SEP)win32$(SEP)kernel32$(SEP)errcodes.rc
|
||||
|
||||
BUILDNO_H = include$(SEP)reactos$(SEP)buildno.h
|
||||
BUGCODES_H = include$(SEP)reactos$(SEP)bugcodes.h
|
||||
BUGCODES_RC = ntoskrnl$(SEP)bugcodes.rc
|
||||
ERRCODES_H = include$(SEP)reactos$(SEP)errcodes.h
|
||||
ERRCODES_RC = dll$(SEP)win32$(SEP)kernel32$(SEP)errcodes.rc
|
||||
|
||||
include lib/lib.mak
|
||||
include tools/tools.mak
|
||||
@@ -397,16 +358,12 @@ PREAUTO := \
|
||||
$(BUGCODES_RC) \
|
||||
$(ERRCODES_H) \
|
||||
$(ERRCODES_RC) \
|
||||
$(GENDIB_DIB_FILES) \
|
||||
$(NCI_SERVICE_FILES)
|
||||
ifeq ($(ARCH),powerpc)
|
||||
PREAUTO += $(OFW_INTERFACE_SERVICE_FILES) $(PPCMMU_TARGETS)
|
||||
endif
|
||||
$(NCI_SERVICE_FILES) \
|
||||
$(GENDIB_DIB_FILES)
|
||||
|
||||
$(ROS_AUTOMAKE): $(RBUILD_TARGET) $(XMLBUILDFILES) | $(PREAUTO)
|
||||
${mkdir} $(OUTPUT_)media$(SEP)inf 2>$(NUL)
|
||||
$(ROS_AUTOMAKE): $(RBUILD_TARGET) $(PREAUTO) $(XMLBUILDFILES)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) mingw
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) mingw
|
||||
|
||||
world: all bootcd livecd
|
||||
|
||||
@@ -430,160 +387,117 @@ universe:
|
||||
ROS_OUTPUT=output-$(ARCH)-r \
|
||||
world
|
||||
|
||||
sysregtest:
|
||||
$(OUTPUT_)tools$(SEP)sysreg$(SEP)sysreg$(EXEPOSTFIX) tools$(SEP)sysreg$(SEP)txtmode.cfg
|
||||
|
||||
|
||||
.PHONY: cb
|
||||
cb: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) cb
|
||||
|
||||
.PHONY: msbuild
|
||||
msbuild: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) msbuild
|
||||
|
||||
.PHONY: msbuild_clean
|
||||
msbuild_clean: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -c msbuild
|
||||
|
||||
.PHONY: depmap
|
||||
depmap: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) depmap
|
||||
|
||||
.PHONY: vreport
|
||||
vreport:$(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) vreport
|
||||
|
||||
.PHONY: msvc
|
||||
msvc: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) msvc
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) msvc
|
||||
|
||||
$(BUGCODES_H) $(BUGCODES_RC): $(WMC_TARGET) $(NTOSKRNL_MC)
|
||||
${mkdir} $(INTERMEDIATE_)include$(SEP)reactos 2>$(NUL)
|
||||
${mkdir} $(INTERMEDIATE_)ntoskrnl 2>$(NUL)
|
||||
$(ECHO_WMC)
|
||||
$(Q)$(WMC_TARGET) -i -H $(BUGCODES_H) -o $(BUGCODES_RC) $(NTOSKRNL_MC)
|
||||
|
||||
$(ERRCODES_H) $(ERRCODES_RC): $(WMC_TARGET) $(KERNEL32_MC)
|
||||
${mkdir} $(INTERMEDIATE_)include$(SEP)reactos 2>$(NUL)
|
||||
${mkdir} $(INTERMEDIATE_)dll$(SEP)win32$(SEP)kernel32 2>$(NUL)
|
||||
$(ECHO_WMC)
|
||||
$(Q)$(WMC_TARGET) -i -U -H $(ERRCODES_H) -o $(ERRCODES_RC) $(KERNEL32_MC)
|
||||
|
||||
.PHONY: msvc6
|
||||
msvc6: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs6.00 -voversionconfiguration msvc
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs6.00 msvc
|
||||
|
||||
.PHONY: msvc7
|
||||
msvc7: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs7.00 -voversionconfiguration msvc
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs7.00 msvc
|
||||
|
||||
.PHONY: msvc71
|
||||
msvc71: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs7.10 -voversionconfiguration msvc
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs7.10 msvc
|
||||
|
||||
.PHONY: msvc8
|
||||
msvc8: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs8.00 -voversionconfiguration msvc
|
||||
|
||||
.PHONY: msvc9
|
||||
msvc9: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs9.00 -voversionconfiguration msvc
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs8.00 msvc
|
||||
|
||||
.PHONY: msvc6_clean
|
||||
msvc6_clean: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -c -vs6.00 -voversionconfiguration msvc
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -c -vs6.00 msvc
|
||||
|
||||
.PHONY: msvc7_clean
|
||||
msvc7_clean: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -c -vs7.00 -voversionconfiguration msvc
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -c -vs7.00 msvc
|
||||
|
||||
.PHONY: msvc71_clean
|
||||
msvc71_clean: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -c -vs7.10 -voversionconfiguration msvc
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -c -vs7.10 msvc
|
||||
|
||||
.PHONY: msvc8_clean
|
||||
msvc8_clean: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -c -vs8.00 -voversionconfiguration msvc
|
||||
|
||||
.PHONY: msvc9_clean
|
||||
msvc9_clean: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -c -vs9.00 -voversionconfiguration msvc
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -c -vs8.00 msvc
|
||||
|
||||
.PHONY: msvc_clean
|
||||
msvc_clean: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -c msvc
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -c msvc
|
||||
|
||||
.PHONY: msvc_clean_all
|
||||
msvc_clean_all: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -c -vs6.00 -voversionconfiguration msvc
|
||||
$(Q)$(RBUILD_TARGET) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -c -vs7.00 -voversionconfiguration msvc
|
||||
$(Q)$(RBUILD_TARGET) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -c -vs7.10 -voversionconfiguration msvc
|
||||
$(Q)$(RBUILD_TARGET) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -c -vs8.10 -voversionconfiguration msvc
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -c -vs6.00 msvc
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -c -vs7.00 msvc
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -c -vs7.10 msvc
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -c -vs8.10 msvc
|
||||
|
||||
.PHONY: msvc7_install_debug
|
||||
msvc7_install_debug: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs7.00 -vcdebug -voversionconfiguration msvc
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs7.00 -vcdebug msvc
|
||||
|
||||
.PHONY: msvc7_install_release
|
||||
msvc7_install_release: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs7.00 -vcrelease -voversionconfiguration msvc
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs7.00 -vcrelease msvc
|
||||
|
||||
.PHONY: msvc7_install_speed
|
||||
msvc7_install_speed: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs7.00 -vcspeed -voversionconfiguration msvc
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs7.00 -vcspeed msvc
|
||||
|
||||
.PHONY: msvc71_install_debug
|
||||
msvc71_install_debug: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs7.10 -vcdebug -voversionconfiguration msvc
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs7.10 -vcdebug msvc
|
||||
|
||||
.PHONY: msvc71_install_release
|
||||
msvc71_install_release: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs7.10 -vcrelease -voversionconfiguration msvc
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs7.10 -vcrelease msvc
|
||||
|
||||
|
||||
.PHONY: msvc71_install_speed
|
||||
msvc71_install_speed: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs7.10 -vcspeed -voversionconfiguration msvc
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs7.10 -vcspeed msvc
|
||||
|
||||
.PHONY: msvc8_install_debug
|
||||
msvc8_install_debug: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs8.00 -vcdebug -voversionconfiguration msvc
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs8.00 -vcdebug msvc
|
||||
|
||||
.PHONY: msvc8_install_release
|
||||
msvc8_install_release: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs8.00 -vcrelease -voversionconfiguration msvc
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs8.00 -vcrelease msvc
|
||||
|
||||
.PHONY: msvc8_install_speed
|
||||
msvc8_install_speed: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs8.00 -vcspeed -voversionconfiguration msvc
|
||||
$(Q)$(RBUILD_TARGET) $(ROS_RBUILDFLAGS) -vs8.00 -vcspeed msvc
|
||||
|
||||
.PHONY: makefile_auto_clean
|
||||
makefile_auto_clean:
|
||||
@@ -593,6 +507,6 @@ makefile_auto_clean:
|
||||
clean: makefile_auto_clean
|
||||
|
||||
.PHONY: depends
|
||||
depends: $(RBUILD_TARGET)
|
||||
$(ECHO_RBUILD)
|
||||
$(Q)$(RBUILD_TARGET) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) mingw
|
||||
depends:
|
||||
@-$(rm) makefile.auto
|
||||
@$(MAKE) $(filter-out depends, $(MAKECMDGOALS))
|
||||
|
@@ -1,6 +1,6 @@
|
||||
========================
|
||||
ReactOS Version 0.3.x
|
||||
Updated Dec 16, 2006
|
||||
ReactOS Version 0.2.x
|
||||
Updated June 23rd, 2004
|
||||
========================
|
||||
|
||||
1. What is ReactOS?
|
||||
@@ -8,11 +8,10 @@ Updated Dec 16, 2006
|
||||
ReactOS is an Open Source effort to develop a quality operating system
|
||||
that is compatible with Windows NT applications and drivers.
|
||||
|
||||
The ReactOS project, although currently focused on Windows XP/2003
|
||||
drivers compatibility, is always keeping an eye toward compatibility with
|
||||
older version of Windows NT family ( NT 4.0, 2000 (NT 5.0)) and new
|
||||
Windows NT releases (Vista, etc). Applications (Win32 API) compatibility
|
||||
focus is Windows XP.
|
||||
The ReactOS project, although currently focused on Windows NT 4.0
|
||||
compatibility, is always keeping an eye toward compatibility with
|
||||
future Windows NT releases, that is, Windows 2000 (NT 5.0) and
|
||||
Windows XP (NT 5.1).
|
||||
|
||||
More information is available at http://www.reactos.org/.
|
||||
|
||||
@@ -22,8 +21,8 @@ See the INSTALL file for more details.
|
||||
|
||||
3. More information
|
||||
|
||||
See the media\doc subdirectory for some sparse notes.
|
||||
See the doc subdirectory for some sparse notes
|
||||
|
||||
4. Who is responsible
|
||||
|
||||
See the CREDITS file.
|
||||
See the CREDITS file
|
@@ -1,78 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE group SYSTEM "tools/rbuild/project.dtd">
|
||||
<group xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
<xi:include href="baseaddress.rbuild" />
|
||||
<xi:include href="buildfamilies.rbuild" />
|
||||
<xi:include href="contributors.rbuild" />
|
||||
<xi:include href="installfolders.rbuild" />
|
||||
<xi:include href="languages.rbuild" />
|
||||
|
||||
<define name="__REACTOS__" overridable="true" />
|
||||
<if property="MP" value="1">
|
||||
<define name="CONFIG_SMP">1</define>
|
||||
</if>
|
||||
<if property="DBG" value="1">
|
||||
<define name="DBG">1</define>
|
||||
<define name="_SEH_ENABLE_TRACE" />
|
||||
<property name="DBG_OR_KDBG" value="true" />
|
||||
</if>
|
||||
<if property="KDBG" value="1">
|
||||
<define name="KDBG">1</define>
|
||||
<property name="DBG_OR_KDBG" value="true" />
|
||||
</if>
|
||||
|
||||
<include>.</include>
|
||||
<include>include</include>
|
||||
<include root="intermediate">include</include>
|
||||
<include>include/psdk</include>
|
||||
<include root="intermediate">include/psdk</include>
|
||||
<include>include/dxsdk</include>
|
||||
<include>include/crt</include>
|
||||
<include>include/crt/mingw32</include>
|
||||
<include>include/ddk</include>
|
||||
<include>include/GL</include>
|
||||
<include>include/ndk</include>
|
||||
<include>include/reactos</include>
|
||||
<include root="intermediate">include/reactos</include>
|
||||
<include>include/reactos/libs</include>
|
||||
|
||||
<directory name="base">
|
||||
<xi:include href="base/base.rbuild" />
|
||||
</directory>
|
||||
<directory name="boot">
|
||||
<xi:include href="boot/boot.rbuild" />
|
||||
</directory>
|
||||
<directory name="dll">
|
||||
<xi:include href="dll/dll.rbuild" />
|
||||
</directory>
|
||||
<directory name="drivers">
|
||||
<xi:include href="drivers/drivers.rbuild" />
|
||||
</directory>
|
||||
<directory name="hal">
|
||||
<xi:include href="hal/hal.rbuild" />
|
||||
</directory>
|
||||
<directory name="include">
|
||||
<xi:include href="include/directory.rbuild" />
|
||||
</directory>
|
||||
<directory name="lib">
|
||||
<xi:include href="lib/lib.rbuild" />
|
||||
</directory>
|
||||
<directory name="media">
|
||||
<xi:include href="media/media.rbuild" />
|
||||
</directory>
|
||||
<directory name="modules">
|
||||
<xi:include href="modules/directory.rbuild" />
|
||||
</directory>
|
||||
<directory name="ntoskrnl">
|
||||
<xi:include href="ntoskrnl/ntoskrnl.rbuild" />
|
||||
</directory>
|
||||
<directory name="subsystems">
|
||||
<xi:include href="subsystems/subsystems.rbuild" />
|
||||
</directory>
|
||||
|
||||
<xi:include href="platform.rbuild">
|
||||
<xi:fallback>
|
||||
<xi:include href="platform.template.rbuild" />
|
||||
</xi:fallback>
|
||||
</xi:include>
|
||||
</group>
|
@@ -1,46 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE project SYSTEM "tools/rbuild/project.dtd">
|
||||
<project name="ReactOS" makefile="makefile.auto" architecture="i386" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
<xi:include href="config.rbuild">
|
||||
<xi:fallback>
|
||||
<xi:include href="config.template.rbuild" />
|
||||
</xi:fallback>
|
||||
</xi:include>
|
||||
|
||||
<xi:include href="ReactOS-generic.rbuild" />
|
||||
|
||||
<define name="_M_IX86" />
|
||||
<define name="_X86_" />
|
||||
<define name="__i386__" />
|
||||
|
||||
<property name="NTOSKRNL_SHARED" value="-Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -nostartfiles -shared"/>
|
||||
|
||||
<if property="GDB" value="0">
|
||||
<if property="OPTIMIZE" value="1">
|
||||
<compilerflag>-Os</compilerflag>
|
||||
<compilerflag>-ftracer</compilerflag>
|
||||
<compilerflag>-momit-leaf-frame-pointer</compilerflag>
|
||||
<compilerflag>-mpreferred-stack-boundary=2</compilerflag>
|
||||
</if>
|
||||
<if property="OPTIMIZE" value="2">
|
||||
<compilerflag>-Os</compilerflag>
|
||||
<compilerflag>-mpreferred-stack-boundary=2</compilerflag>
|
||||
</if>
|
||||
<if property="OPTIMIZE" value="3">
|
||||
<compilerflag>-O1</compilerflag>
|
||||
<compilerflag>-mpreferred-stack-boundary=2</compilerflag>
|
||||
</if>
|
||||
<if property="OPTIMIZE" value="4">
|
||||
<compilerflag>-O2</compilerflag>
|
||||
<compilerflag>-mpreferred-stack-boundary=2</compilerflag>
|
||||
</if>
|
||||
<if property="OPTIMIZE" value="5">
|
||||
<compilerflag>-O3</compilerflag>
|
||||
<compilerflag>-mpreferred-stack-boundary=2</compilerflag>
|
||||
</if>
|
||||
</if>
|
||||
|
||||
<compilerflag>-Wno-strict-aliasing</compilerflag>
|
||||
<compilerflag>-Wpointer-arith</compilerflag>
|
||||
<linkerflag>-enable-stdcall-fixup</linkerflag>
|
||||
</project>
|
@@ -1,40 +1,94 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE project SYSTEM "tools/rbuild/project.dtd">
|
||||
<project name="ReactOS" makefile="makefile.ppc" architecture="powerpc" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
<xi:include href="config-ppc.rbuild">
|
||||
<xi:fallback>
|
||||
<xi:include href="config-ppc.template.rbuild" />
|
||||
</xi:fallback>
|
||||
</xi:include>
|
||||
<project name="ReactOS" makefile="makefile.ppc" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
<xi:include href="config-ppc.rbuild">
|
||||
<xi:fallback>
|
||||
<xi:include href="config-ppc.template.rbuild" />
|
||||
</xi:fallback>
|
||||
</xi:include>
|
||||
|
||||
<xi:include href="ReactOS-generic.rbuild" />
|
||||
<xi:include href="baseaddress.rbuild" />
|
||||
|
||||
<define name="_M_PPC" />
|
||||
<define name="_PPC_" />
|
||||
<define name="__PowerPC__" />
|
||||
<property name="BOOTPROG_PREPARE" value="ppc-le2be" />
|
||||
<property name="BOOTPROG_FLATFORMAT" value="-O elf32-powerpc -B powerpc:common" />
|
||||
<property name="BOOTPROG_LINKFORMAT" value="-melf32ppc --no-omagic -Ttext 0xe00000 -Tdata 0xe10000" />
|
||||
<property name="BOOTPROG_COPYFORMAT" value="--only-section=.text --only-section=.data --only-section=.bss -O aixcoff-rs6000" />
|
||||
|
||||
<property name="MKHIVE_OPTIONS" value="-be" />
|
||||
<property name="OFWLDR_LINKFORMAT" value="-L$(INTERMEDIATE)/lib/ppcmmu -lppcmmu_code -nostdlib -nostartfiles -lgcc -Wl,-e,__start -Wl,-Ttext,0xe00000 -N"/>
|
||||
<property name="NTOSKRNL_SHARED" value="-Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -nostartfiles"/>
|
||||
<define name="_M_PPC" />
|
||||
<define name="_PPC_" />
|
||||
<define name="__PowerPC__" />
|
||||
<define name="_REACTOS_" />
|
||||
<define name="__MINGW_IMPORT" empty="true" />
|
||||
<define name="stdcall" empty="true" />
|
||||
<define name="__stdcall__" empty="true" />
|
||||
<define name="fastcall" empty="true" />
|
||||
<define name="cdecl" empty="true" />
|
||||
<define name="__cdecl__" empty="true" />
|
||||
<define name="dllimport" empty="true" />
|
||||
<compilerflag>-v</compilerflag>
|
||||
<if property="MP" value="1">
|
||||
<define name="CONFIG_SMP" value="1" />
|
||||
</if>
|
||||
<if property="DBG" value="1">
|
||||
<define name="DBG" value="1" />
|
||||
<property name="DBG_OR_KDBG" value="true" />
|
||||
</if>
|
||||
<if property="DBG" value="0">
|
||||
<compilerflag>-Os</compilerflag>
|
||||
<compilerflag>-Wno-strict-aliasing</compilerflag>
|
||||
</if>
|
||||
<if property="KDBG" value="1">
|
||||
<define name="KDBG" value="1" />
|
||||
<property name="DBG_OR_KDBG" value="true" />
|
||||
</if>
|
||||
<compilerflag>-Wpointer-arith</compilerflag>
|
||||
|
||||
<define name="stdcall"/>
|
||||
<define name="__stdcall__"/>
|
||||
<define name="fastcall"/>
|
||||
<define name="cdecl"/>
|
||||
<define name="__cdecl__"/>
|
||||
<define name="dllimport"/>
|
||||
<define name="WORDS_BIGENDIAN"/>
|
||||
<define name="__MSVCRT__"/>
|
||||
<define name="__NO_CTYPE_INLINES" />
|
||||
<!-- <define name="__DECLSPEC_SUPPORTED" /> -->
|
||||
<define name="__MINGW_IMPORT">extern</define>
|
||||
<define name="_CRTIMP"/>
|
||||
<define name="'__declspec(x)'"/>
|
||||
<compilerflag>-fshort-wchar</compilerflag>
|
||||
<compilerflag>-fsigned-char</compilerflag>
|
||||
<compilerflag>-mfull-toc</compilerflag>
|
||||
<compilerflag>-meabi</compilerflag>
|
||||
<compilerflag>-O2</compilerflag>
|
||||
<compilerflag>-Wno-strict-aliasing</compilerflag>
|
||||
<include>.</include>
|
||||
<include>include</include>
|
||||
<include>include/reactos</include>
|
||||
<include>include/libs</include>
|
||||
<include>include/drivers</include>
|
||||
<include>include/subsys</include>
|
||||
<include>include/ndk</include>
|
||||
<include>include</include>
|
||||
<include>include/crt</include>
|
||||
<include>include/ddk</include>
|
||||
|
||||
<directory name="base">
|
||||
<xi:include href="base/base.rbuild" />
|
||||
</directory>
|
||||
<directory name="boot">
|
||||
<xi:include href="boot/boot.rbuild" />
|
||||
</directory>
|
||||
<directory name="dll">
|
||||
<xi:include href="dll/dll.rbuild" />
|
||||
</directory>
|
||||
<directory name="drivers">
|
||||
<xi:include href="drivers/drivers.rbuild" />
|
||||
</directory>
|
||||
<directory name="hal">
|
||||
<xi:include href="hal/hal.rbuild" />
|
||||
</directory>
|
||||
<directory name="include">
|
||||
<xi:include href="include/directory.rbuild" />
|
||||
</directory>
|
||||
<directory name="lib">
|
||||
<xi:include href="lib/lib.rbuild" />
|
||||
</directory>
|
||||
<directory name="media">
|
||||
<xi:include href="media/media.rbuild" />
|
||||
</directory>
|
||||
<directory name="modules">
|
||||
<xi:include href="modules/directory.rbuild" />
|
||||
</directory>
|
||||
<directory name="ntoskrnl">
|
||||
<xi:include href="ntoskrnl/ntoskrnl.rbuild" />
|
||||
</directory>
|
||||
<directory name="regtests">
|
||||
<xi:include href="regtests/directory.rbuild" />
|
||||
</directory>
|
||||
<directory name="subsystems">
|
||||
<xi:include href="subsystems/subsystems.rbuild" />
|
||||
</directory>
|
||||
|
||||
</project>
|
||||
|
83
reactos/ReactOS.rbuild
Normal file
83
reactos/ReactOS.rbuild
Normal file
@@ -0,0 +1,83 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE project SYSTEM "tools/rbuild/project.dtd">
|
||||
<project name="ReactOS" makefile="makefile.auto" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
<xi:include href="config.rbuild">
|
||||
<xi:fallback>
|
||||
<xi:include href="config.template.rbuild" />
|
||||
</xi:fallback>
|
||||
</xi:include>
|
||||
|
||||
<xi:include href="baseaddress.rbuild" />
|
||||
|
||||
<define name="_M_IX86" />
|
||||
<define name="_X86_" />
|
||||
<define name="__i386__" />
|
||||
<define name="_REACTOS_" />
|
||||
<if property="MP" value="1">
|
||||
<define name="CONFIG_SMP" value="1" />
|
||||
</if>
|
||||
<if property="DBG" value="1">
|
||||
<define name="DBG" value="1" />
|
||||
<property name="DBG_OR_KDBG" value="true" />
|
||||
</if>
|
||||
<if property="KDBG" value="1">
|
||||
<define name="KDBG" value="1" />
|
||||
<property name="DBG_OR_KDBG" value="true" />
|
||||
</if>
|
||||
|
||||
<if property="GDB" value="0">
|
||||
<compilerflag>-Os</compilerflag>
|
||||
<compilerflag>-Wno-strict-aliasing</compilerflag>
|
||||
<compilerflag>-ftracer</compilerflag>
|
||||
<compilerflag>-momit-leaf-frame-pointer</compilerflag>
|
||||
<compilerflag>-mpreferred-stack-boundary=2</compilerflag>
|
||||
</if>
|
||||
<compilerflag>-Wpointer-arith</compilerflag>
|
||||
|
||||
<include>.</include>
|
||||
<include>include</include>
|
||||
<include>include/crt</include>
|
||||
<include>include/ddk</include>
|
||||
<include>include/GL</include>
|
||||
<include>include/ndk</include>
|
||||
<include>include/reactos</include>
|
||||
<include>include/reactos/libs</include>
|
||||
|
||||
<directory name="base">
|
||||
<xi:include href="base/base.rbuild" />
|
||||
</directory>
|
||||
<directory name="boot">
|
||||
<xi:include href="boot/boot.rbuild" />
|
||||
</directory>
|
||||
<directory name="dll">
|
||||
<xi:include href="dll/dll.rbuild" />
|
||||
</directory>
|
||||
<directory name="drivers">
|
||||
<xi:include href="drivers/drivers.rbuild" />
|
||||
</directory>
|
||||
<directory name="hal">
|
||||
<xi:include href="hal/hal.rbuild" />
|
||||
</directory>
|
||||
<directory name="include">
|
||||
<xi:include href="include/directory.rbuild" />
|
||||
</directory>
|
||||
<directory name="lib">
|
||||
<xi:include href="lib/lib.rbuild" />
|
||||
</directory>
|
||||
<directory name="media">
|
||||
<xi:include href="media/media.rbuild" />
|
||||
</directory>
|
||||
<directory name="modules">
|
||||
<xi:include href="modules/directory.rbuild" />
|
||||
</directory>
|
||||
<directory name="ntoskrnl">
|
||||
<xi:include href="ntoskrnl/ntoskrnl.rbuild" />
|
||||
</directory>
|
||||
<directory name="regtests">
|
||||
<xi:include href="regtests/directory.rbuild" />
|
||||
</directory>
|
||||
<directory name="subsystems">
|
||||
<xi:include href="subsystems/subsystems.rbuild" />
|
||||
</directory>
|
||||
|
||||
</project>
|
@@ -3,27 +3,27 @@
|
||||
; COMPONENT_NAME - Name of the component. Eg. kernel32.dll.
|
||||
; PATH_TO_COMPONENT_SOURCES - Relative path to sources (relative to
|
||||
; where rgenstat is run from).
|
||||
advapi32.dll reactos/dll/win32/advapi32
|
||||
crtdll.dll reactos/dll/win32/crtdll
|
||||
gdi32.dll reactos/dll/win32/gdi32
|
||||
gdiplus.dll reactos/dll/win32/gdiplus
|
||||
iphlpapi.dll reactos/dll/win32/iphlpapi
|
||||
kernel32.dll reactos/dll/win32/kernel32
|
||||
lz32.dll reactos/dll/win32/lzexpand
|
||||
msvcrt.dll reactos/dll/win32/msvcrt
|
||||
rpcrt4.dll reactos/dll/win32/rpcrt4
|
||||
secur32.dll reactos/dll/win32/secur32
|
||||
snmpapi.dll reactos/dll/win32/snmpapi
|
||||
user32.dll reactos/dll/win32/user32
|
||||
version.dll reactos/dll/win32/version
|
||||
winspool.dll reactos/dll/win32/winspool
|
||||
ws2_32.dll reactos/dll/win32/ws2_32
|
||||
wsock32.dll reactos/dll/win32/wsock32
|
||||
advapi32.dll reactos/lib/advapi32
|
||||
crtdll.dll reactos/lib/crtdll
|
||||
gdi32.dll reactos/lib/gdi32
|
||||
gdiplus.dll reactos/lib/gdiplus
|
||||
iphlpapi.dll reactos/lib/iphlpapi
|
||||
kernel32.dll reactos/lib/kernel32
|
||||
lz32.dll reactos/lib/lzexpand
|
||||
msvcrt.dll reactos/lib/msvcrt
|
||||
rpcrt4.dll reactos/lib/rpcrt4
|
||||
secur32.dll reactos/lib/secur32
|
||||
snmpapi.dll reactos/lib/snmpapi
|
||||
user32.dll reactos/lib/user32
|
||||
version.dll reactos/lib/version
|
||||
winspool.dll reactos/lib/winspool
|
||||
ws2_32.dll reactos/lib/ws2_32
|
||||
wsock32.dll reactos/lib/wsock32
|
||||
videoprt.dll reactos/drivers/video/videoprt
|
||||
ndis.sys reactos/drivers/network/ndis
|
||||
tdi.sys reactos/drivers/network/tdi
|
||||
ndis.sys reactos/drivers/net/ndis
|
||||
tdi.sys reactos/drivers/net/tdi
|
||||
class2.sys reactos/drivers/storage/class2
|
||||
scsiport.sys reactos/drivers/storage/scsiport
|
||||
ntoskrnl.exe reactos/ntoskrnl
|
||||
ntoskrnl.exe reactos/lib/rtl
|
||||
win32k.sys reactos/subsystems/win32/win32k
|
||||
win32k.sys reactos/subsys/win32k
|
||||
|
@@ -1,39 +1,33 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE group SYSTEM "../../tools/rbuild/project.dtd">
|
||||
<group xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
<!DOCTYPE project SYSTEM "tools/rbuild/project.dtd">
|
||||
<group>
|
||||
<directory name="cacls">
|
||||
<xi:include href="cacls/cacls.rbuild" />
|
||||
</directory>
|
||||
<directory name="calc">
|
||||
<xi:include href="calc/calc.rbuild" />
|
||||
</directory>
|
||||
<directory name="charmap">
|
||||
<xi:include href="charmap/charmap.rbuild" />
|
||||
</directory>
|
||||
<directory name="cmdutils">
|
||||
<xi:include href="cmdutils/cmdutils.rbuild" />
|
||||
</directory>
|
||||
<directory name="control">
|
||||
<xi:include href="control/control.rbuild" />
|
||||
<directory name="devmgr">
|
||||
<xi:include href="devmgr/devmgr.rbuild" />
|
||||
</directory>
|
||||
<directory name="games">
|
||||
<xi:include href="games/games.rbuild" />
|
||||
</directory>
|
||||
<directory name="hh">
|
||||
<xi:include href="hh/hh.rbuild" />
|
||||
<directory name="getfirefox">
|
||||
<xi:include href="getfirefox/getfirefox.rbuild" />
|
||||
</directory>
|
||||
<directory name="hostname">
|
||||
<xi:include href="hostname/hostname.rbuild" />
|
||||
</directory>
|
||||
<directory name="logoff">
|
||||
<xi:include href="logoff/logoff.rbuild" />
|
||||
<directory name="ibrowser">
|
||||
<xi:include href="ibrowser/ibrowser.rbuild" />
|
||||
</directory>
|
||||
<directory name="imagesoft">
|
||||
<xi:include href="imagesoft/imagesoft.rbuild" />
|
||||
</directory>
|
||||
<directory name="msconfig">
|
||||
<xi:include href="msconfig/msconfig.rbuild" />
|
||||
</directory>
|
||||
<directory name="mscutils">
|
||||
<xi:include href="mscutils/directory.rbuild" />
|
||||
</directory>
|
||||
<directory name="network">
|
||||
<xi:include href="network/network.rbuild" />
|
||||
</directory>
|
||||
@@ -43,12 +37,21 @@
|
||||
<directory name="regedit">
|
||||
<xi:include href="regedit/regedit.rbuild" />
|
||||
</directory>
|
||||
<directory name="reporterror">
|
||||
<xi:include href="reporterror/reporterror.rbuild" />
|
||||
</directory>
|
||||
<directory name="sc">
|
||||
<xi:include href="sc/sc.rbuild" />
|
||||
</directory>
|
||||
<directory name="screensavers">
|
||||
<xi:include href="screensavers/screensavers.rbuild" />
|
||||
</directory>
|
||||
<directory name="screenshot">
|
||||
<xi:include href="screenshot/screenshot.rbuild" />
|
||||
</directory>
|
||||
<directory name="servman">
|
||||
<xi:include href="servman/servman.rbuild" />
|
||||
</directory>
|
||||
<directory name="shutdown">
|
||||
<xi:include href="shutdown/shutdown.rbuild" />
|
||||
</directory>
|
||||
@@ -58,10 +61,16 @@
|
||||
<directory name="taskmgr">
|
||||
<xi:include href="taskmgr/taskmgr.rbuild" />
|
||||
</directory>
|
||||
<directory name="winhelp">
|
||||
<xi:include href="winhelp/winhelp.rbuild" />
|
||||
<directory name="winefile">
|
||||
<xi:include href="winefile/winefile.rbuild" />
|
||||
</directory>
|
||||
<directory name="wordpad">
|
||||
<xi:include href="wordpad/wordpad.rbuild" />
|
||||
</directory>
|
||||
<directory name="control">
|
||||
<xi:include href="control/control.rbuild" />
|
||||
</directory>
|
||||
<directory name="utils">
|
||||
<xi:include href="utils/utils.rbuild" />
|
||||
</directory>
|
||||
</group>
|
||||
|
74
reactos/base/applications/cacls/En.rc
Normal file
74
reactos/base/applications/cacls/En.rc
Normal file
@@ -0,0 +1,74 @@
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
|
||||
IDS_HELP, "Displays or modifies access control lists (ACLs) of files\n\n\
|
||||
CACLS filename [/T] [/E] [/C] [/G user:perm [...]] [/R user [...]]\n\
|
||||
[/P user:perm [...]] [/D user [...]]\n\
|
||||
filename Displays ACLs.\n\
|
||||
/T Changes ACLs of specified files in\n\
|
||||
the current directory and all subdirectories.\n\
|
||||
/E Edit ACL instead of replacing it.\n\
|
||||
/C Continue on access denied errors.\n\
|
||||
/G user:perm Grant specified user access rights.\n\
|
||||
Perm can be: R Read\n\
|
||||
W Write\n\
|
||||
C Change (write)\n\
|
||||
F Full control\n\
|
||||
/R user Revoke specified user's access rights (only valid with /E).\n\
|
||||
/P user:perm Replace specified user's access rights.\n\
|
||||
Perm can be: N None\n\
|
||||
R Read\n\
|
||||
W Write\n\
|
||||
C Change (write)\n\
|
||||
F Full control\n\
|
||||
/D user Deny specified user access.\n\
|
||||
Wildcards can be used to specify more that one file in a command.\n\
|
||||
You can specify more than one user in a command.\n\n\
|
||||
Abbreviations:\n\
|
||||
CI - Container Inherit.\n\
|
||||
The ACE will be inherited by directories.\n\
|
||||
OI - Object Inherit.\n\
|
||||
The ACE will be inherited by files.\n\
|
||||
IO - Inherit Only.\n\
|
||||
The ACE does not apply to the current file/directory.\n"
|
||||
|
||||
IDS_ABBR_CI, "(CI)"
|
||||
IDS_ABBR_OI, "(OI)"
|
||||
IDS_ABBR_IO, "(IO)"
|
||||
IDS_ABBR_FULL, "F"
|
||||
IDS_ABBR_READ, "R"
|
||||
IDS_ABBR_WRITE, "W"
|
||||
IDS_ABBR_CHANGE, "C"
|
||||
IDS_ABBR_NONE, "N"
|
||||
IDS_ALLOW, ""
|
||||
IDS_DENY, "(DENY)"
|
||||
IDS_SPECIAL_ACCESS, "(special access:)"
|
||||
IDS_GENERIC_READ, "GENERIC_READ"
|
||||
IDS_GENERIC_WRITE, "GENERIC_WRITE"
|
||||
IDS_GENERIC_EXECUTE, "GENERIC_EXECUTE"
|
||||
IDS_GENERIC_ALL, "GENERIC_ALL"
|
||||
IDS_FILE_GENERIC_EXECUTE, "FILE_GENERIC_EXECUTE"
|
||||
IDS_FILE_GENERIC_READ, "FILE_GENERIC_READ"
|
||||
IDS_FILE_GENERIC_WRITE, "FILE_GENERIC_WRITE"
|
||||
IDS_FILE_READ_DATA, "FILE_READ_DATA"
|
||||
IDS_FILE_WRITE_DATA, "FILE_WRITE_DATA"
|
||||
IDS_FILE_APPEND_DATA, "FILE_APPEND_DATA"
|
||||
IDS_FILE_READ_EA, "FILE_READ_EA"
|
||||
IDS_FILE_WRITE_EA, "FILE_WRITE_EA"
|
||||
IDS_FILE_EXECUTE, "FILE_EXECUTE"
|
||||
IDS_FILE_DELETE_CHILD, "FILE_DELETE_CHILD"
|
||||
IDS_FILE_READ_ATTRIBUTES, "FILE_READ_ATTRIBUTES"
|
||||
IDS_FILE_WRITE_ATTRIBUTES, "FILE_WRITE_ATTRIBUTES"
|
||||
IDS_MAXIMUM_ALLOWED, "MAXIMUM_ALLOWED"
|
||||
IDS_ACCESS_SYSTEM_SECURITY, "ACCESS_SYSTEM_SECURITY"
|
||||
IDS_SPECIFIC_RIGHTS_ALL, "SPECIFIC_RIGHTS_ALL"
|
||||
IDS_STANDARD_RIGHTS_REQUIRED, "STANDARD_RIGHTS_REQUIRED"
|
||||
IDS_SYNCHRONIZE, "SYNCHRONIZE"
|
||||
IDS_WRITE_OWNER, "WRITE_OWNER"
|
||||
IDS_WRITE_DAC, "WRITE_DAC"
|
||||
IDS_READ_CONTROL, "READ_CONTROL"
|
||||
IDS_DELETE, "DELETE"
|
||||
IDS_STANDARD_RIGHTS_ALL, "STANDARD_RIGHTS_ALL"
|
||||
}
|
75
reactos/base/applications/cacls/Nl.rc
Normal file
75
reactos/base/applications/cacls/Nl.rc
Normal file
@@ -0,0 +1,75 @@
|
||||
LANGUAGE LANG_DUTCH, SUBLANG_NEUTRAL
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
|
||||
IDS_HELP, "ACL's (Access Control Lists, toegangslijsten) van bestanden weergeven\nof bewerken\n\nCACLS bestandsnaam [/T] [/E] [/C] [/G gebr:toeg] [/R gebruiker [...]]\n\
|
||||
[/P gebr:toeg [...]] [/D gebruiker [...]]\n\
|
||||
bestandsnaam ACL's weergeven.\n\
|
||||
/T ACL's wijzigen van opgegeven bestanden in\n\
|
||||
de huidige map en alle submappen.\n\
|
||||
/E ACL bewerken in plaats van vervangen.\n\
|
||||
/C Doorgaan bij toegang geweigerd.\n\
|
||||
/G gebr:toeg Opgegeven gebruiker toegangsrechten verlenen.\n\
|
||||
Toeg kan zijn: R Lezen\n\
|
||||
W Schrijven\n\
|
||||
C Wijzigen (schrijven)\n\
|
||||
F Volledig beheer\n\
|
||||
/R gebruiker Toegangsrechten van opgegeven gebruiker intrekken.\n\
|
||||
[alleen geldig met /E].\n\
|
||||
/P gebr:toeg Toegangsrechten van opgegeven gebruiker vervangen.\n\
|
||||
Toeg kan zijn: N Geen\n\
|
||||
R Lezen\n\
|
||||
W Schrijven\n\
|
||||
C Wijzigen (schrijven)\n\
|
||||
F Volledig beheer\n\
|
||||
/D gebruiker Opgegeven gebruiker toegang weigeren.\n\
|
||||
U kunt jokertekens gebruiken om meerdere bestanden op te geven in een\n\
|
||||
opdracht. U kunt meerdere gebruikers opgeven in een opdracht.\n\n\
|
||||
Afkortingen:\n\
|
||||
CI - Container Inherit.\n\
|
||||
De toegangslijst wordt door mappen overgenomen.\n\
|
||||
OI - Object Inherit.\n\
|
||||
De toegangslijst wordt door bestanden overgenomen.\n\
|
||||
IO - Inherit Only.\n\
|
||||
De toegangslijst is niet van toepassing op het huidige bestand of\n\
|
||||
de huidige map.\n"
|
||||
|
||||
IDS_ABBR_CI, "(CI)"
|
||||
IDS_ABBR_OI, "(OI)"
|
||||
IDS_ABBR_IO, "(IO)"
|
||||
IDS_ABBR_FULL, "F"
|
||||
IDS_ABBR_READ, "R"
|
||||
IDS_ABBR_WRITE, "W"
|
||||
IDS_ABBR_CHANGE, "C"
|
||||
IDS_ABBR_NONE, "N"
|
||||
IDS_ALLOW, ""
|
||||
IDS_DENY, "(DENY)"
|
||||
IDS_SPECIAL_ACCESS, "(speciale toegang:)"
|
||||
IDS_GENERIC_READ, "GENERIC_READ"
|
||||
IDS_GENERIC_WRITE, "GENERIC_WRITE"
|
||||
IDS_GENERIC_EXECUTE, "GENERIC_EXECUTE"
|
||||
IDS_GENERIC_ALL, "GENERIC_ALL"
|
||||
IDS_FILE_GENERIC_EXECUTE, "FILE_GENERIC_EXECUTE"
|
||||
IDS_FILE_GENERIC_READ, "FILE_GENERIC_READ"
|
||||
IDS_FILE_GENERIC_WRITE, "FILE_GENERIC_WRITE"
|
||||
IDS_FILE_READ_DATA, "FILE_READ_DATA"
|
||||
IDS_FILE_WRITE_DATA, "FILE_WRITE_DATA"
|
||||
IDS_FILE_APPEND_DATA, "FILE_APPEND_DATA"
|
||||
IDS_FILE_READ_EA, "FILE_READ_EA"
|
||||
IDS_FILE_WRITE_EA, "FILE_WRITE_EA"
|
||||
IDS_FILE_EXECUTE, "FILE_EXECUTE"
|
||||
IDS_FILE_DELETE_CHILD, "FILE_DELETE_CHILD"
|
||||
IDS_FILE_READ_ATTRIBUTES, "FILE_READ_ATTRIBUTES"
|
||||
IDS_FILE_WRITE_ATTRIBUTES, "FILE_WRITE_ATTRIBUTES"
|
||||
IDS_MAXIMUM_ALLOWED, "MAXIMUM_ALLOWED"
|
||||
IDS_ACCESS_SYSTEM_SECURITY, "ACCESS_SYSTEM_SECURITY"
|
||||
IDS_SPECIFIC_RIGHTS_ALL, "SPECIFIC_RIGHTS_ALL"
|
||||
IDS_STANDARD_RIGHTS_REQUIRED, "STANDARD_RIGHTS_REQUIRED"
|
||||
IDS_SYNCHRONIZE, "SYNCHRONIZE"
|
||||
IDS_WRITE_OWNER, "WRITE_OWNER"
|
||||
IDS_WRITE_DAC, "WRITE_DAC"
|
||||
IDS_READ_CONTROL, "READ_CONTROL"
|
||||
IDS_DELETE, "DELETE"
|
||||
IDS_STANDARD_RIGHTS_ALL, "STANDARD_RIGHTS_ALL"
|
||||
}
|
@@ -507,8 +507,18 @@ PrintSpecialAccess:
|
||||
}
|
||||
|
||||
|
||||
int __cdecl _tmain(int argc, const TCHAR *argv[])
|
||||
#ifdef _UNICODE
|
||||
int __cdecl main(void)
|
||||
#else
|
||||
int __cdecl _main (int argc, char *argv[])
|
||||
#endif
|
||||
{
|
||||
#ifdef _UNICODE
|
||||
PWCHAR *argv;
|
||||
int argc = 0;
|
||||
argv = CommandLineToArgvW(GetCommandLineW(), &argc);
|
||||
#endif
|
||||
|
||||
if (argc < 2)
|
||||
{
|
||||
PrintHelp();
|
||||
|
@@ -1,16 +1,14 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
|
||||
<module name="cacls" type="win32cui" installbase="system32" installname="cacls.exe" unicode="true">
|
||||
<module name="cacls" type="win32cui" installbase="system32" installname="cacls.exe" usewrc="false">
|
||||
<include base="cacls">.</include>
|
||||
<define name="__USE_W32API" />
|
||||
<define name="UNICODE" />
|
||||
<define name="_UNICODE" />
|
||||
<define name="_WIN32_IE">0x0500</define>
|
||||
<define name="_WIN32_WINNT">0x0600</define>
|
||||
<define name="WINVER">0x0600</define>
|
||||
<library>kernel32</library>
|
||||
<library>advapi32</library>
|
||||
<library>ntdll</library>
|
||||
<library>user32</library>
|
||||
<library>shell32</library>
|
||||
<file>cacls.c</file>
|
||||
<file>cacls.rc</file>
|
||||
<pch>precomp.h</pch>
|
||||
|
@@ -6,5 +6,8 @@
|
||||
#define REACTOS_STR_ORIGINAL_FILENAME "cacls.exe\0"
|
||||
#include <reactos/version.rc>
|
||||
|
||||
#include "rsrc.rc"
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
|
||||
#include "En.rc"
|
||||
#include "Nl.rc"
|
||||
|
||||
|
@@ -1,74 +0,0 @@
|
||||
LANGUAGE LANG_BULGARIAN, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
|
||||
IDS_HELP, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (ACL <20><><EFBFBD> <20><><EFBFBD>) <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n\n\
|
||||
CACLS <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>_<EFBFBD><5F><EFBFBD> [/T] [/E] [/C] [/G <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:<3A><><EFBFBD><EFBFBD><EFBFBD> [...]] [/R <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> [...]]\n\
|
||||
[/P <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:<3A><><EFBFBD><EFBFBD><EFBFBD> [...]] [/D <20><><EFBFBD> [...]]\n\
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>_<EFBFBD><5F><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD>.\n\
|
||||
/T <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>\n\
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. \n\
|
||||
/E <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.\n\
|
||||
/C <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.\n\
|
||||
/G <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:<3A><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.\n\
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20><>: R <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n\
|
||||
W <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n\
|
||||
C <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)\n\
|
||||
F <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>\n\
|
||||
/R <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Revoke specified user's access rights (only valid with /E).\n\
|
||||
/P <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:<3A><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.\n\
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><>: N <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n\
|
||||
R <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n\
|
||||
W <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n\
|
||||
C <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)\n\
|
||||
F <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> \n\
|
||||
/D <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.\n\
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> (* <20> ?) <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>..\n\n\
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:\n\
|
||||
CI <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.\n\
|
||||
ACE <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.\n\
|
||||
OI <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>).\n\
|
||||
ACE <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.\n\
|
||||
IO - Inherit Only.\n\
|
||||
<20><><EFBFBD><EFBFBD> <20><> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ACE <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>/ <20><><EFBFBD><EFBFBD><EFBFBD>.\n"
|
||||
|
||||
IDS_ABBR_CI, "(CI)"
|
||||
IDS_ABBR_OI, "(OI)"
|
||||
IDS_ABBR_IO, "(IO)"
|
||||
IDS_ABBR_FULL, "F"
|
||||
IDS_ABBR_READ, "R"
|
||||
IDS_ABBR_WRITE, "W"
|
||||
IDS_ABBR_CHANGE, "C"
|
||||
IDS_ABBR_NONE, "N"
|
||||
IDS_ALLOW, ""
|
||||
IDS_DENY, "(DENY)"
|
||||
IDS_SPECIAL_ACCESS, "(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>:)"
|
||||
IDS_GENERIC_READ, "GENERIC_READ"
|
||||
IDS_GENERIC_WRITE, "GENERIC_WRITE"
|
||||
IDS_GENERIC_EXECUTE, "GENERIC_EXECUTE"
|
||||
IDS_GENERIC_ALL, "GENERIC_ALL"
|
||||
IDS_FILE_GENERIC_EXECUTE, "FILE_GENERIC_EXECUTE"
|
||||
IDS_FILE_GENERIC_READ, "FILE_GENERIC_READ"
|
||||
IDS_FILE_GENERIC_WRITE, "FILE_GENERIC_WRITE"
|
||||
IDS_FILE_READ_DATA, "FILE_READ_DATA"
|
||||
IDS_FILE_WRITE_DATA, "FILE_WRITE_DATA"
|
||||
IDS_FILE_APPEND_DATA, "FILE_APPEND_DATA"
|
||||
IDS_FILE_READ_EA, "FILE_READ_EA"
|
||||
IDS_FILE_WRITE_EA, "FILE_WRITE_EA"
|
||||
IDS_FILE_EXECUTE, "FILE_EXECUTE"
|
||||
IDS_FILE_DELETE_CHILD, "FILE_DELETE_CHILD"
|
||||
IDS_FILE_READ_ATTRIBUTES, "FILE_READ_ATTRIBUTES"
|
||||
IDS_FILE_WRITE_ATTRIBUTES, "FILE_WRITE_ATTRIBUTES"
|
||||
IDS_MAXIMUM_ALLOWED, "MAXIMUM_ALLOWED"
|
||||
IDS_ACCESS_SYSTEM_SECURITY, "ACCESS_SYSTEM_SECURITY"
|
||||
IDS_SPECIFIC_RIGHTS_ALL, "SPECIFIC_RIGHTS_ALL"
|
||||
IDS_STANDARD_RIGHTS_REQUIRED, "STANDARD_RIGHTS_REQUIRED"
|
||||
IDS_SYNCHRONIZE, "SYNCHRONIZE"
|
||||
IDS_WRITE_OWNER, "WRITE_OWNER"
|
||||
IDS_WRITE_DAC, "WRITE_DAC"
|
||||
IDS_READ_CONTROL, "READ_CONTROL"
|
||||
IDS_DELETE, "DELETE"
|
||||
IDS_STANDARD_RIGHTS_ALL, "STANDARD_RIGHTS_ALL"
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user