Re: Add support for Windows 8, first step

2011-10-12 Thread Corinna Vinschen
Hi Teemu,

First of all, we need a copyright assignment from you before we can
accept non-trivial patches to Cygwin, see http://cygwin.com/contrib.html,
the Before you get started section.

On Oct 11 22:38, Teemu Nätkinniemi wrote:
 Hello!
 
 Here's a small patch that enables Cygwin to run on Windows 8 (tested
 on x64 build 8102, the Windows Developer Preview). Windows 8 does
 not seem to support FAST_CWD or the current implementation of
 FAST_CWD is not compatible with Windows 8 so it is disabled at the
 moment.

Windows 8 will very likely support the FAST_CWD stuff, the problem is
just to find out how to find the global pointer pointing to the current
FAST_CWD structure, and then, if the FAST_CWD structure changed.

Having this annoying message at startup was intentional, so that we
know that there's some work to do yet.  However, personally I don't plan
to look into W8 so soon.  Stuff like that is bound to change this early
in the release game anyway.

Therefore I don't want to disable this message.  If you're interested
to get rid of it, it would be most helpful trying to track down how to
find the global FAST_CWD pointer in W8.


Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  cygwin AT cygwin DOT com
Red Hat


Re: Add support for Windows 8, first step

2011-10-12 Thread Teemu Nätkinniemi

Hello Corinna,

On 12.10.2011 11:26, Corinna Vinschen wrote:


First of all, we need a copyright assignment from you before we can
accept non-trivial patches to Cygwin, see http://cygwin.com/contrib.html,
the Before you get started section.


I am going to do that just in case I actually get something working (see 
below).



Windows 8 will very likely support the FAST_CWD stuff, the problem is
just to find out how to find the global pointer pointing to the current
FAST_CWD structure, and then, if the FAST_CWD structure changed.


It does do that, the code looks almost the same as in Windows 7. There 
are some differences that I haven't figured out yet. But I might 
actually wait for a beta version of Windows 8 before going forward.



Therefore I don't want to disable this message.  If you're interested
to get rid of it, it would be most helpful trying to track down how to
find the global FAST_CWD pointer in W8.


If I understood the code correctly f_cwd_ptr is the location of 
ntdll!RtlpCurDirRef and find_fast_cwd_pointer tries to find that 
location. For some reason I couldn't get breakpoints working when 
debugging cygwin1.dll so I did some disassembling and found the correct 
location for ntdll!RtlpCurDirRef in Windows 8 version of ntdll (wow64).


Any hints for debugging the Cygwin dll itself as find_fast_cwd runs once 
per session so it has been very difficult trying to get a working 
breakpoint.


Teemu


Add support for Windows 8, first step

2011-10-11 Thread Teemu Nätkinniemi

Hello!

Here's a small patch that enables Cygwin to run on Windows 8 (tested on 
x64 build 8102, the Windows Developer Preview). Windows 8 does not seem 
to support FAST_CWD or the current implementation of FAST_CWD is not 
compatible with Windows 8 so it is disabled at the moment.


Teemu Nätkinniemi
2011-10-11  Teemu Nätkinniemi  tnatk...@gmail.com

* wincap.cc (wincap_8): Add support to Windows 8
(wincapc::init): Ditto

--- wincap.cc.orig  2011-07-30 23:51:03.0 +0300
+++ wincap.cc   2011-10-11 22:13:44.556795800 +0300
@@ -263,6 +263,36 @@
   has_stack_size_param_is_a_reservation:true,
 };
 
+wincaps wincap_8 __attribute__((section (.cygwin_dll_common), shared)) = {
+  max_sys_priv:SE_CREATE_SYMBOLIC_LINK_PRIVILEGE,
+  is_server:false,
+  has_physical_mem_access:false,
+  has_create_global_privilege:true,
+  has_ioctl_storage_get_media_types_ex:true,
+  has_disk_ex_ioctls:true,
+  has_buggy_restart_scan:false,
+  has_mandatory_integrity_control:true,
+  needs_logon_sid_in_sid_list:false,
+  needs_count_in_si_lpres2:false,
+  has_recycle_dot_bin:true,
+  has_gaa_prefixes:true,
+  has_gaa_on_link_prefix:true,
+  supports_all_posix_ai_flags:true,
+  has_restricted_stack_args:false,
+  has_transactions:true,
+  has_recvmsg:true,
+  has_sendmsg:true,
+  has_broken_udf:false,
+  has_console_handle_problem:true,
+  has_broken_alloc_console:true,
+  has_always_all_codepages:true,
+  has_localenames:true,
+  has_fast_cwd:false,
+  has_restricted_raw_disk_access:true,
+  use_dont_resolve_hack:false,
+  has_stack_size_param_is_a_reservation:true,
+};
+
 wincapc wincap __attribute__((section (.cygwin_dll_common), shared));
 
 void
@@ -320,9 +350,12 @@
  case 0:
caps = wincap_vista;
break;
- default:
+ case 1:
caps = wincap_7;
break;
+ default:
+   caps = wincap_8;
+   break;
}
  break;
default: