Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Feb 19, 2012, 10:36 AM   #1
james124816
macrumors newbie
 
Join Date: Feb 2012
Convert 32bit program to 64bit version

how would you accomplish this..wanting to convert fancontrol for the macbook pro from 32 bit pref pane to 64bit pref pane.
__________________
Jim
james124816 is offline   0 Reply With Quote
Old Feb 19, 2012, 10:45 AM   #2
hwojtek
macrumors 6502a
 
Join Date: Jan 2008
Location: A small rural village in western Poland
1. Get ahold of source code and adjust it for 64 bit architecture.
2. Compile for 64-bit (or even better do a 32/64 fat binary).
3. Debug all combinations of hardware vs architecture.
4. More changes to the code.
5. Compile again as in 2.
6. Go to 3.
7. If it works, sell it. If no, go to 3 again.

Thank you for using my impromptu "There is no 64-bit version of an app I really need to use because otherwise" programming workflow.
__________________
Wojtek
More Macs than I can count, really. Like 20 or so...
hwojtek is offline   1 Reply With Quote
Old Feb 19, 2012, 11:24 AM   #3
KnightWRX
macrumors Pentium
 
KnightWRX's Avatar
 
Join Date: Jan 2009
Location: Quebec, Canada
Most of the time, there really is no real work to do aside from just recompiling for a 64 bit platform. APIs/Frameworks and code using them are becoming more and more size agnostic as far as variables go. There really is little code left that assumes a specific memory size for a specific variable and that doesn't use "garanteed" size types like uint32 or other such things.
__________________
"What you leave behind is not what is engraved in stone monuments, but what is woven into the lives of others."
-- Pericles
KnightWRX is offline   0 Reply With Quote
Old Feb 20, 2012, 04:10 AM   #4
hwojtek
macrumors 6502a
 
Join Date: Jan 2008
Location: A small rural village in western Poland
Yeah, but we're talking direct hardware access in this one.
__________________
Wojtek
More Macs than I can count, really. Like 20 or so...
hwojtek is offline   0 Reply With Quote
Old Feb 20, 2012, 06:22 AM   #5
KnightWRX
macrumors Pentium
 
KnightWRX's Avatar
 
Join Date: Jan 2009
Location: Quebec, Canada
Quote:
Originally Posted by hwojtek View Post
Yeah, but we're talking direct hardware access in this one.
You can't do direct hardware access on OS X unless you're running in kernel space. Fancontrol runs in user space as far as I can see. Also, the OP is asking from the Preference pane, which is only a front-end. the actual control of the Fan is done by a userspace daemon launched on startup.

I don't have access to the source code, lacking a working DMG extractor, so I can't look more deeply into it, but really unless there's code in there that assumes variable width (like int = 4 bytes), then it's just an issue of building a 64 bit binary.

With the source being available (at least for the version I found), it shouldn't be a tremendous task.
__________________
"What you leave behind is not what is engraved in stone monuments, but what is woven into the lives of others."
-- Pericles
KnightWRX is offline   0 Reply With Quote
Old Feb 20, 2012, 09:41 AM   #6
chown33
macrumors 603
 
Join Date: Aug 2009
Quote:
Originally Posted by KnightWRX View Post
You can't do direct hardware access on OS X unless you're running in kernel space. Fancontrol runs in user space as far as I can see. Also, the OP is asking from the Preference pane, which is only a front-end. the actual control of the Fan is done by a userspace daemon launched on startup.
There is no reason that a daemon would need to be 64-bits, even if the pref-pane that talks to it is 64-bits. Separate processes, separate architectures.

So it's quite possible that the daemon could remain 32-bit, while the pref-pane could be converted to 64-bit (assuming it needs any conversion at all, other than recompiling for 64-bit).
chown33 is offline   0 Reply With Quote
Old Feb 20, 2012, 11:05 AM   #7
KnightWRX
macrumors Pentium
 
KnightWRX's Avatar
 
Join Date: Jan 2009
Location: Quebec, Canada
Quote:
Originally Posted by chown33 View Post
There is no reason that a daemon would need to be 64-bits, even if the pref-pane that talks to it is 64-bits. Separate processes, separate architectures.

So it's quite possible that the daemon could remain 32-bit, while the pref-pane could be converted to 64-bit (assuming it needs any conversion at all, other than recompiling for 64-bit).
I don't think that was ever put into the question. I only pointed out that the OP was only wanting a 64 bit pref-pane.
__________________
"What you leave behind is not what is engraved in stone monuments, but what is woven into the lives of others."
-- Pericles
KnightWRX is offline   0 Reply With Quote
Old May 26, 2013, 11:14 PM   #8
Applemi
macrumors newbie
 
Join Date: May 2013
Is there a converter that I could download that covert programs from 32 to 64 bit.
Applemi is offline   0 Reply With Quote
Old May 27, 2013, 02:36 AM   #9
Cromulent
macrumors 603
 
Cromulent's Avatar
 
Join Date: Oct 2006
Location: The Land of Hope and Glory
Quote:
Originally Posted by Applemi View Post
Is there a converter that I could download that covert programs from 32 to 64 bit.
No.
__________________
Neural Advance - Mac OS X, UNIX and Windows Development
Last.fm Profile | Extreme Metal Reviews
MP 4x 2.66Ghz Xeons / 6GB RAM / 640GB + 500GB + 750GB + 1TB HDDs / ATI Radeon 4870 / iPad 3
Cromulent is offline   0 Reply With Quote
Old May 27, 2013, 03:15 AM   #10
weichsel
macrumors newbie
 
Join Date: May 2013
Quote:
Is there a converter that I could download that covert programs from 32 to 64 bit.
Apple provides a script that helps to port an existing 32-bit codebase to 64-bit.
While it doesn't exactly convert (compiled) programs from 32-bit to 64-bit, it at least helps to convert the source code.

The script can be found in Apple's 64-bit Transition Guide.
weichsel is offline   0 Reply With Quote
Old May 27, 2013, 03:40 AM   #11
ytk
macrumors regular
 
Join Date: Jul 2010
Quote:
Originally Posted by Applemi View Post
Is there a converter that I could download that covert programs from 32 to 64 bit.
It's actually really easy. 64 bits is twice as much as 32, so all you need to do is double up the program like this:
Code:
cat 32bit_ver 32bit_ver > 64bit_ver
If you want to really future-proof things, cat together four copies of the program to go all the way to 128-bit.
ytk is offline   2 Reply With Quote
Old May 27, 2013, 10:04 AM   #12
gnasher729
macrumors G5
 
gnasher729's Avatar
 
Join Date: Nov 2005
Quote:
Originally Posted by james124816 View Post
how would you accomplish this..wanting to convert fancontrol for the macbook pro from 32 bit pref pane to 64bit pref pane.
Go to developer.apple.com and type "64 bit" into the search field. You'll want to study the 64 bit transition guide.
gnasher729 is online now   0 Reply With Quote
Old May 27, 2013, 07:26 PM   #13
Mr. Retrofire
macrumors 601
 
Mr. Retrofire's Avatar
 
Join Date: Mar 2010
Location: www.emiliana.cl
Quote:
Originally Posted by KnightWRX View Post
You can't do direct hardware access on OS X unless you're running in kernel space. Fancontrol runs in user space as far as I can see.
He can use the IOKit:
Introduction to Accessing Hardware From Applications
__________________

“Only the dead have seen the end of the war.”
-- Plato --
Mr. Retrofire is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Bootcamp - Win 7 ISO with both 64bit and 32bit bmouthboyo Windows, Linux & Others on the Mac 42 Jul 25, 2014 07:33 PM
LibreOffice 32bit or 64bit for 64bit Mac with OS X 10.8 alex0002 Mac Applications and Mac App Store 3 May 10, 2014 10:58 AM
All iPads: Ipad available Storage capacity 64bit vs 32bit deaglecat iPad 6 Feb 9, 2014 02:04 PM
64bit safari vs. 32bit chrome heboil OS X 10.8 Mountain Lion 0 Sep 21, 2013 11:34 PM
32Bit vs 64Bit Gaming! HBen iMac 5 Dec 19, 2012 09:55 AM

Forum Jump

All times are GMT -5. The time now is 06:03 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC