Free Downloads, Community Forum,
FAQs and Developer Resources


Make /Tools Your Home | Link to us

Today's posts | Posts since last visit | Most Active Topics

All Forums Register Login Search Subscriptions My Profile Inbox
Tool Warehouse FAQs Resources Help Member List Address Book Logout

Mixed up about mixed mode

 
Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [SFU / Interix / SUA Technology] >> Windows Server 2003 R2 SUA >> Mixed up about mixed mode Page: [1]
Login
Message << Older Topic   Newer Topic >>
Mixed up about mixed mode - Jun. 14, '06, 9:59:59 AM   
rapid

 

Posts: 8
Joined: Jun. 1, '06,
Status: offline
Please can someone direct me to a definition of a "mixed mode" application under SUA.

I've compiled a Hello World program under SUA using c89 with VS 2005.

The c89 man page states that the -R flag creates a mixed mode executable.

/bin/c89 -R hello.c creates a Windows-CUI DOS executable

/bin/c89 hello.c creates a Posix-CUI DOS executable

I thought (maybe wrongly) that a mixed mode application was a Posix executable that can call a function in a Windows DLL.

I want to call some Windows functions from a large program which uses many Posix functions. The program works fine under SFU and SUA. How should I go about this ?

Thanks

Rapid
Post #: 1
RE: Mixed up about mixed mode - Jun. 14, '06, 1:18:46 PM   
Rodney

 

Posts: 3695
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
No, you have it reversed.
Each process can only have one "master" as far as which subsystem has authority over it.
The mixed-mode application is a Win32 binary that makes calls to the Interix subsystem.
There is a special communications layer that has been made for Win32 programs to
connect/request API support from the Interix subsystem.
If you could look under the covers you'd find Win32 is not compartmentalized well.
Maybe way back at NT 2.0 it was. I'm speaking to the Mach-like model NT is built on.
On the other hand, Interix still is. So that we the easiest way to do it based on the
way MS has described it.

The best thing to do is give it a try. See what happens.
The docs warn about using fork() and exec() with mixed-mode processes.
So a "better method" of mixed mode may be better, but it would be harder to do.

(in reply to rapid)
Post #: 2
RE: Mixed up about mixed mode - Jun. 17, '06, 2:06:00 AM   
anue

 

Posts: 2
Joined: Dec. 1, '05,
Status: offline
let me just add a little more information. It is true that all Binary in Mixed Mode is Windows Binary type. But when you link hello.c under posix mixed mode, that program uses only POSIX function calls. Your printf's go to the C run time that is shipped with Posix. The Only change that you see is that CSRSS ( Windows Subsystem ) thinks that process is its child process.

However unless you call into a DLL ( that is the real purpose of this Mixed Mode) no running threads will enter CSRSS. So your mental model is correct, you can think of Mixed Mode as a posix program trying to call into Windows DLL. However inorder to achieve that abstraction we have to start the life of the process as a Windows Process and hence you see this Windows CUI bit set.

I hope that clarifies the issue.

regards
Anu

(in reply to Rodney)
Post #: 3
Page:   [1]
All Forums >> [SFU / Interix / SUA Technology] >> Windows Server 2003 R2 SUA >> Mixed up about mixed mode Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Search All Forums -

Advanced search


SPONSORS



Forum Software © ASPPlayground.NET Advanced Edition 2.5 ANSI

0.047