The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: shankle on January 19, 2009, 01:01:09 PM

Title: masm32 and Ubuntu
Post by: shankle on January 19, 2009, 01:01:09 PM
Hope I am putting this in the right place.

I have Ubuntu installed on 1 HD and Vista installed on a 2nd HD.
Quick editor won't work on Ubuntu. I think the reason is that running things in the Root is a NONO  on Ubuntu.
But there might be other reasons that I am not aware of.
I also don't think using Wine will make any difference.
Since I plan on weaning myself from Vista I am wondering if the following is feasible.

Never again use Vista online. Compile my MASM32 programs in Vista and move the .exe files to Ubuntu.

That means I'll never need to defag in Ubuntu, won't need Eset Smart Security, won't need Registry Mechanic, won't need Ccleaner,
won't need a popup stopper, won't have to worry about a 2 way firewall.

That means I can continue to use Vista in this fashion while Windows 7, Windows 8  and Windows 9 comes out. Then I should only
have to buy the overpriced Windows operating system when I get a new Puter.
Very curious about your thoughts on this setup.
Regards,
JPS


Title: Re: masm32 and Ubuntu
Post by: hutch-- on January 19, 2009, 01:33:04 PM
You are out of luck Jack, the two operating systems do not share the basic API functions and are also structurally different. Wine is supposed to have got better but last I saw of it was not impressive. I would imagine that if you want to run native Unix propgrams under Ubuntu you will have to get compilers and assemblers that will work in Ubuntu.
Title: Re: masm32 and Ubuntu
Post by: drhowarddrfine on January 19, 2009, 03:03:34 PM
Quote from: shankle on January 19, 2009, 01:01:09 PM
I think the reason is that running things in the Root is a NONO  on Ubuntu.
You can run anything as root but you shouldn't.
QuoteSince I plan on weaning myself from Vista I am wondering if the following is feasible.
You'll either need fasm or learn AS/GAS.
QuoteNever again use Vista online. Compile my MASM32 programs in Vista and move the .exe files to Ubuntu.
As hutch said, that won't work because the APIs and system calls are all different.
Quote
That means I'll never need to defag in Ubuntu, won't need Eset Smart Security, won't need Registry Mechanic, won't need Ccleaner,
won't need a popup stopper, won't have to worry about a 2 way firewall.
Yep.
Quote
That means I can continue to use Vista in this fashion while Windows 7, Windows 8  and Windows 9 comes out. Then I should only
have to buy the overpriced Windows operating system when I get a new Puter.
You'll quickly find you never switch to Vista.  You may also find you never buy a new computer because Windows users will give you their "old" computer every 2-3 years as they "upgrade" to a new Windows OS.  I have not bought a new computer since 2001.
Title: Re: masm32 and Ubuntu
Post by: shankle on January 19, 2009, 03:24:14 PM
I thank you for your replies.
My God is that discouraging.
But you are the experts and I value your opinions.

Looks like I have a couple of bad options.
1. use Ubuntu for all email and online browsing.
   No email or browsing the web in Windows. Keep web usage to an absolute minimum on Vista.
2. keep on using MASM32.
3. learn fasm and convert all my programs. (lord what a task that would be.)
4. jump over a high cliff.

I've been hassled by one thing or the other in this field. I started out with the IBM main frame Assembler.
Then my bosses (in the infinite wisdom) decided I had to write in Cobol. God what a horrible language.
Then MRRRRRR Gates (after I bought his masm assembler for PCs) obsoleted it.
probably #4 is my best solution.

A disgruntled programmer
Title: Re: masm32 and Ubuntu
Post by: Tedd on January 19, 2009, 03:38:12 PM
Ubuntu is Linux, not Windows - they're not compatible, at all.
However, for most programs you write (probably, all), they will run in Wine. I'd expect masm will work in wine too, but I haven't tried it, and we can guess what the license says about that :P
And while it should work, do you really want to work this way? Writing programs for one system, but running them entirely under another.. It might be worth jumping in feet first and learning the weird ways of Linux asm, and use Wine for compatibility during the 'transition.' There are a few nice linux assemblers to choose from: specifically: nasm and fasm (and others..) and I'm pretty sure they both have enough extra include files and support macros to make it a little nicer.
Title: Re: masm32 and Ubuntu
Post by: Mark Jones on January 19, 2009, 04:17:33 PM
JWASM comes in a linux flavor... still a learning curve, but may be significantly more familiar than GAS:

http://www.japheth.de/JWasm.html
Title: Re: masm32 and Ubuntu
Post by: drhowarddrfine on January 19, 2009, 04:57:26 PM
Quote from: shankle on January 19, 2009, 03:24:14 PM
Looks like I have a couple of bad options.
1. use Ubuntu for all email and online browsing.
   No email or browsing the web in Windows. Keep web usage to an absolute minimum on Vista.
It's no different in Ubuntu so what's the problem with that?
Title: Re: masm32 and Ubuntu
Post by: drhowarddrfine on January 19, 2009, 04:59:22 PM
Quote from: Tedd on January 19, 2009, 03:38:12 PM
It might be worth jumping in feet first and learning the weird ways of Linux asm
You can set GAS to use Intel syntax so it's no different than Windows asm, but I have no issues with using ATT syntax at all.  Different does not make it weird.
Title: Re: masm32 and Ubuntu
Post by: shankle on January 19, 2009, 05:32:34 PM
I would think that online usage and email in Ubuntu would be more secure than Vista.
Am I wrong?
Title: Re: masm32 and Ubuntu
Post by: drhowarddrfine on January 19, 2009, 05:35:14 PM
Quote from: shankle on January 19, 2009, 05:32:34 PM
I would think that online usage and email in Ubuntu would be more secure than Vista.
Am I wrong?
No you're not wrong.  Running in 'nix is far more secure than Vista.
Title: Re: masm32 and Ubuntu
Post by: hutch-- on January 20, 2009, 09:18:56 AM
Jack,

There is nothing wrong with doing your browsing, email and other net based interface stuff in Ubuntu and doing other things in Windows. While Vista appears to be a nightmare, XP, Win2000 and the earlier win9x versions all run OK so you can run any one of them to do your more familiar stuff.

You could develop for Linux but you would have to start from scratch and it may be more work than you want to do. One thing you can do is set up a Samba server in Ubuntu so that you can access the Linux box from Windows through TCP/IP so you pick up the speed of Windows without the irritations of SUDO in Ubuntu.

The last Ubuntu box I set up after wasting a day or two finding all of the reference material ended up being a very fast web server on my local network. I use a 1 gigabit hub and all of the boxes attached to it have 1 gigabit network cards built in and the Apache server, PHP and MySql databases ran like rockets. It was actually a peasure to find something that a Linux box could do well.  :bg
Title: Re: masm32 and Ubuntu
Post by: locche on January 20, 2009, 10:46:22 AM
I hope not to insult anyone here, as this is a masm forum, but the situation sounded pretty desperate:  If you can get hold of TASM 5, it will run on Linux. I'm running Redhat 8,  which is about 7 yrs old.  Frankly, the situation can only have improved. The wine server is from 2002,  and I also have dosbox 0.72.  When I program on Linux, which isn't often, since I naturally prefer masm32, i edit and compile the texts using dosbox, because wine tends to choke on tlink32, and other command line tools.  It is rather tedious, because tasm has not been maintained, but you can program windows executables on your linux machine with the above mentioned gear.
On the bright side, it's a chance to dig up one of those all but forgotten dos editors.  I hope this helps.
Title: Re: masm32 and Ubuntu
Post by: BlackVortex on January 20, 2009, 11:40:49 AM
Never before have I seen tasm (!) ,an ancient red hat version, dosbox and wine in one post. Did you grow up in a circus ?  j/k   :cheekygreen:

If you want to program windows apps on linux, use jwasm, it has the masm syntax.
Title: Re: masm32 and Ubuntu
Post by: Mark Jones on January 20, 2009, 02:59:28 PM
Well in all fairness BV, JWASM is only a few months old. :U
Title: Re: masm32 and Ubuntu
Post by: japheth on January 20, 2009, 05:32:44 PM
DosEmu is also worth a try - at least if you know what DOS is. Once it is installed, one can use HXRT to run Win32 console apps (Masm, Tasm, JWasm) in Linux. Runs faster than in DosBox, and is less complicated than Wine.
Title: Re: masm32 and Ubuntu
Post by: locche on January 20, 2009, 10:10:33 PM
Sorry if I confused you Black Vortex by using 3 concepts in one post.  I assumed in a masm32 forum we would all be able to multi task. Okay, switching to real mode....
In my view:  A pc exists to get things done.  If I wish to achieve my goal, then I need to know how communicate to the hardware what is required of it. Since every OS has its strengths and weakness, so a pragmatic approach is required,  Realpolitik, if you will.  So depending on the task, one might use an unstable overhyped unix clone like linux or our old lovable MS Windows. Maybe the thought of switching between the 2 OS brought to your mind an image of juggling. Maybe that's where the circus metaphor arose.  However, when I recall the last 2 decades of Microsoft:  The horrors of realising that winword on win 3x won't be  returning
and there's a 20 page semester work about to share the same fate, to the post 97 office with animated "creatures" dancing across your desktop asking you if you want to write a letter whilst your attempting a (because it's Microsoft) complicated vb macro to do something "simple",  to a memory and hdd space devouring  graphical OS which means the trash for the Pentium 3 and 4 generations OR a variety of "Desktop environments" which change from distribution to distrubution full of GUI applications which cannot work because one distributor places /etc/configmeifyoucan in   /usr/configthis whilst the others place it in /etc/config/findmeifyoucan to having to recompilie a kernel in 200x to include support for NTFS... I ask you: Who didn't grow up in a circus?  If I haven't just
left you somewhere on the stack then I proceed to the following observations:
First, tasm32 and tlink32 are command line tools.  Wine is a windows emulator. Calling wine with tasm32 is has a similiar effect to dropping your source code on the compiler icon. This is why I use dosbox.
Secondly,  32 bit windows applications don't agree much with a dos environment. This is why I use wine, to run the applications.
Last, the question pertained to running masm32 in a linux environment, which is why I mentioned Red Hat.  As the OS still does what I require, why would I upgrade to a newer version, which is just as costly in terms of hardware as vista?
Just as an afterthought, masm32 doesn't perform the install. This is not to say it wouldn't run. Office 2000 did do the install, and works fine so long as one avoids the help functions which cause the paperclip of death to appear and crash your application.  In my experience the wine apis work fine, but no .chm please.

I only wanted to help, but that circus comment may mislead others into believing windows assembly with a commercial assembler is neither possible nor feasible. The road less travelled may prove itself more pleasant.




Title: Re: masm32 and Ubuntu
Post by: redskull on January 21, 2009, 12:37:52 AM
Also, just to confirm, using masm to assemble programs for operating systems other than Windows (even if you get it to work), is strictly against the license, is it not?

-alan
Title: Re: masm32 and Ubuntu
Post by: BlackVortex on January 21, 2009, 02:50:05 AM
Quote from: redskull on January 21, 2009, 12:37:52 AM
Also, just to confirm, using masm to assemble programs for operating systems other than Windows (even if you get it to work), is strictly against the license, is it not?

-alan
But we're talking about programming for windows, just using linux as the main OS, so I'm not sure.  When in doubt, use Jwasm.

Also, in this day of emulation and virtualization, you can run virtually (pun intended) anything ... anywhere.

@locche : tl;dr, but I see you're heartbroken, although I was just kidding. It wasn't an insult, just that using those workarounds regularly and for serious jobs is a balancing act.
Hence the witty circus comment    :lol
Title: Re: masm32 and Ubuntu
Post by: locche on January 21, 2009, 09:57:02 AM
yeah. bv cried all night over my Ray Duncan scripts that the text is smeared.  I enjoyed the image of a circus but couldn't resist the 3 items in one post part. Hope your Ralph Brown kept dry. Peaceful reboot.
Title: Re: masm32 and Ubuntu
Post by: carlos on February 06, 2009, 11:18:33 PM
Shankle

Wine will run masm32 and programs you write,  the results as hutch had said in not impressive, but why instead of having a dual boot machine don't you install a virtual machine manager,  VMware cost money, (the server version is free), but virtualbox is free, install any of them in ubuntu, create a virtual machine, and install windows in that VM that way you could have the best of both worlds, use masm in windows environment, and linux for everything else,  as a bonus, you could have linux work as a file server for windows, and if you save the VM files to a dvd, you could recover fast from a windows disaster

in August 2007 I switched from win to ubuntu, I will never go back, except for masm coding, I use the win Vm for little else, and since I'm learning GAS now, some day I may get rid of It,

Welcome to the Linux world , you won't regret it

Carlos Pacheco
Title: Re: masm32 and Ubuntu
Post by: shankle on February 07, 2009, 02:23:35 AM
Thank you Carlos for your reply.
I looked on Ubuntu and found these items in the repositories:
Virtualbox-ose
Virtualbox-ose-source
Virtualbox-ose-guest-source
Vboxgtk
Virtualbox-ose-dbg
Wouldn't have the vaguest idea which one to install.
This is a completely new idea to me. Being 100% green on Ubuntu
I have no idea how to install a virtual machine in Ubuntu. Is it something like
Wubi would do? How would I do backups and manage a web site etc.?
At the present time I have no idea how to do a backup from Ubuntu.
I do know how to do it in Windows.
It still doesn't solve the problem of running MASM32 programs in a Linux environment.
I think I realize that can't be done.
I guess eventually I will have use one of the many Linux Assembler languages.
But which one and especially why? Everyone advises to use the one he is familiar with which
is not necessarily the best one. Personally I think I will wind up maintaining my programs
in MASM32 and also converting them to some Assembler language in Linux.
An awful lot of work. But nothings easy.
I would like to hear some more details on your suggestion if you have the time.
JPS
Title: Re: masm32 and Ubuntu
Post by: drhowarddrfine on February 07, 2009, 04:34:04 PM
@shankle,
Too many questions for here.  You really should be asking those on the Ubuntu forum.
Title: Re: masm32 and Ubuntu
Post by: shankle on February 07, 2009, 05:18:23 PM
ok, will do.
Just thought that Carlos might answer come of them.
Title: Re: masm32 and Ubuntu
Post by: carlos on February 09, 2009, 07:31:35 PM
Hi shankle

first, go to the ubuntu forums http://ubuntuforums.org/ and create an account NOW!!!  :toothy  :toothy  :toothy being a linux newbie (as I was, (and still I am)) this is your biggest source of help.

next, select virtualbox in synaptic, it will mark any dependencies (extra files needed) vbox will need, click install and synaptic will locate download and install Virtualbox, (or any package you chose)

run vbox, the process is intuitive, at least for a asm coder,

don't try to make a huge disk for windows, is better a small (6 - 10 Gb) virtual HD and use linux as a fileserver, (whit Samba, or activating folder sharing in vBox)

without Wine (or any emulator you choose) is impossible to run a win program in ubuntu, (or any linux ) they are essentially different beasts
if you plan to write programs for both platforms in assembler you had to remember the first caveat of assembler  Is Non Portable.

which assembler you should chose, JWasm run in windows and linux, but I hadn't tried it,  Nasm also do it, and is masm like but the macro is different, personally I'm learning (g)as, why? because is the standard in any linux distribution, is different, is weird (being ATT based), and is hard, (having being designed as a back end for the C compiler), but it will not stop a assembler coder, or will it?
if you had any doubts I'm glad to Help

Carlos
Title: Re: masm32 and Ubuntu
Post by: GregL on February 09, 2009, 08:10:41 PM
Quote from: carlos... is weird (being ATT based) ...

You can switch gas to Intel syntax. Use .intel_syntax noprefix. Unless you really want to use ATT syntax, I absolutely hate ATT syntax.

Title: Re: masm32 and Ubuntu
Post by: drhowarddrfine on February 09, 2009, 09:19:28 PM
Well, I have no issues whatsoever using ATT syntax.
Title: Re: masm32 and Ubuntu
Post by: GregL on February 10, 2009, 10:37:39 PM
drhowarddrfine,

To each his own.

Title: Re: masm32 and Ubuntu
Post by: shankle on February 10, 2009, 11:22:28 PM
Installed the Virtualbox in Ubuntu.
Then tried to install XP PRO in the virtualbox and I died right there.
My CD is a re-installation CD.
So I think I am back to the Dual Booting scenario.
Dell only gives re-installation CDs as far as I know.
Title: Re: masm32 and Ubuntu
Post by: xmetal on February 11, 2009, 05:59:17 AM
Quote from: shankle on February 10, 2009, 11:22:28 PM
Installed the Virtualbox in Ubuntu.
Then tried to install XP PRO in the virtualbox and I died right there.
My CD is a re-installation CD.
So I think I am back to the Dual Booting scenario.
Dell only gives re-installation CDs as far as I know.

Can you elaborate on what went wrong? I remember doing a "fresh" Windows XP install with my own Dell "re-installation" CD.
Title: Re: masm32 and Ubuntu
Post by: sinsi on February 11, 2009, 06:04:04 AM
To freshly (re)install xp, all you need is a full version and your key. Basically all you pay for with xp is the 25 digit key.
Title: Re: masm32 and Ubuntu
Post by: MichaelW on February 11, 2009, 07:40:21 AM
All of the Dell XP reinstallation CDs that I have seen had a normal i386 directory that contained all of the files necessary to do a clean install, or at least everything that I needed for an unattended install. How, or if, this would work in VirtualBox I have no idea.
Title: Re: masm32 and Ubuntu
Post by: shankle on February 11, 2009, 01:20:15 PM
Thanks for the replies.
This install of XP is not a normal install. A normal install works.
This install is in a "VirtualBox" that is within Ubuntu.
That's what does not work with a reinstallation CD.
Title: Re: masm32 and Ubuntu
Post by: carlos on February 11, 2009, 06:03:05 PM
HI Shankle
these recovery cd are very handy for fixing windows, but they only works with the machine they were designed to, (to avoid piracy he, he, he)
since virtualbox creates a "vanilla" PC they don't "recognize" it has it's own, but there may be a light at the end of the tunnel, (I hope is not a speeding train :toothy), in UBCD for Windows http://www.ubcd4win.com you could get an application to "slipstream"  a service pack in a old install cd, generating a new cd in the process, try it it may work, also you don't have to burn the new cd, VBox let's you attach a cd image as a cd drive.

hope this help you

Carlos
Title: Re: masm32 and Ubuntu
Post by: MichaelW on February 11, 2009, 08:42:14 PM
I wouldn't expect whatever reinstall application that Dell provided to work. I am talking about doing an unattended install using only the files in the i386 directory. From the VirtualBox User Manual, Version 2.1.2:
Quote
In order to allow for completely unattended guest installations of Windows 2000 and
XP, the Guest Additions driver files have been put separately on the Additions ISO
file. Just like with other third-party drivers, the files have to be copied to the OEM
directory of Windows. Using the PCI hardware detection, they will then be recognized
and installed automatically.

Although I'm not sure what all of this means, it does look like an unattended install could be made to work. I would guess that "OEM directory of Windows" means the i386 directory. If you have the Microsoft CD for Windows 2000 or Windows XP, the unattended setup information should be in SUPPORT\TOOLS\DEPLOY.CAB, in deploy.chm for Windows XP or unattend.doc for Windows 2000.

Here is a generic example of the answer file I have used many times, unattend.txt:

;
; This answer file specifies the essential parameters for
; a fully unattended setup. It is intended for performing
; a clean install (over a fresh format, no upgrade or
; dual-boot) from the command line. It may need to be
; modified for other purposes.
;
; To start a Windows 2000 or Windows XP setup in unattended
; mode from the command line:
;
; winnt /u:<answer file> /s:<install source> /t:<target drive>
;

[Unattended]

UnattendMode = FullUnattended

; Alternate is ConvertNTFS:
FileSystem = LeaveAlone

; A common alternate is Windows:
TargetPath = WINNT

; This is necessary for setup to accept ProductID:
OemSkipEula = Yes

[UserData]

; Whatever:
ComputerName = "X"

; This will be the registered-to name:
FullName = "User"

; The Product Key goes here:
ProductID = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"

[GuiUnattended]

; This specifies a null password:
AdminPassword = *

; This specifies Central Time Zone, can be changed after install:
TimeZone = "020"

; This section header is necessary for unattended install:
[Networking]

[Identification]

; This specifies the workgroup name:
JoinWorkgroup = Workgroup


I normally do this from a Windows 98 Boot Disk, and this is the batch file I normally use to launch the setup:

@echo off

copy unattend.txt c:\

d:
cd winxp\i386

echo.
echo REMOVE BOOT DISKETTE AFTER SETUP STARTS
echo.

pause

winnt /u:c:\unattend.txt /s:d:\winxp\i386 /t:c


This assumes that the entire i386 directory has been copied from the CD to the directory winxp on drive D. If everything works correctly, Windows installs without user intervention in around 30 minutes, depending on the speed of the system.