grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Mingw support for grub2


From: Christian Franke
Subject: Re: [PATCH] Mingw support for grub2
Date: Sun, 24 Aug 2008 18:42:54 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080702 SeaMonkey/1.1.11

Vesa Jääskeläinen wrote:
Bean wrote:
On Mon, Aug 25, 2008 at 12:04 AM, Vesa Jääskeläinen <address@hidden> wrote:
Bean wrote:
Yes, it works, although mingw can't use device names like /dev/sda,
but it can use windows special name //./PHYSICALDRIVE0.
That should be with back slashes ('\'). Or is there some hack somewhere
to support that?
Hi,

Mingw would translate / to \, so both are ok. But using / is more
clear, as \ is the escape character in cygwin shell, so we need to use
two of them, \\\\.\\PHYSICALDRIVE0.

In cygwin shell... yes... but mingw programs are not meant to be run
under that. Mingw programs are native windows programs.



Unlike Cygwin, Mingw does not provide an extra library layer. Most standard library functions directly link to msvcrt.dll.

The Win32 API (like the DOS API) itself accepts both / and \, only the user level tools usually don't. This is likely because in the early (CP/M->DOS) days, someone decided to use '/' as the option char. Later, when path names are 'borrowed' from Unix, it was too late :-)

In fact, all these work to open the first disk:
h = CreateFile("\\\\.\\PhysicalDrive0", ...)
h = CreateFile("\\\\./PhysicalDrive0", ...)
h = CreateFile("//.\\PhysicalDrive0", ...)
h = CreateFile("//./PhysicalDrive0", ...)

Christian





reply via email to

[Prev in Thread] Current Thread [Next in Thread]