Fresh IDE FASM inside

Advanced setup manual

The upcoming version 3.0 of Fresh IDE will be fully portable, but until then, we have to use the Windows version of Fresh.

Nevertheless, development of Windows and Linux applications in the same time is possible and easy with the current version of Fresh.

The good news are that Fresh IDE runs like a charm in ?999:https://www.winehq.org/images/winehq_logo_glass.pngWine.

So, now (since v2.0.5) we have a choice - whatever OS we choose we can develop applications for Linux and Windows, including editing, compiling, running and debugging. Of course we are talking about GUI applications.

The installation of Fresh is easy, but if we want to use the full potential of the IDE some setup and adjustments are necessary. Let see how to setup Fresh IDE for work in Windows and Linux:

1. Windows setup

In order to run Linux native applications inside Windows, Fresh uses special Linux distribution - andLinux.

andLinux is complete Ubuntu distribution, that uses coLinux kernel in order to allow running of Linux inside Windows OS.

How to setup andLinux to work with Fresh?

1.1. Download andLinux

Download andLinux package from andLinux download page

There are two packages: "KDE version" and "minimal/XFCE version" available. For use with Fresh IDE, it is not important what version you will choose.

KDE package is very big and very slow distribution that contains many bundled programs and tools, but in general you will not need them. The size of KDE package is 500MB download and 5GB installed.

The XFCE package is relatively smaller and faster. Relatively means 200MB downloaded file and 2GB installed on the disk.

It is obvious that the right choice is to use XFCE package.

1.2. Install andLinux

Run the downloaded setup file and answer to the different questions of the setup wizard:

coLinux version - choose the stable version (0.7.4 in my case) instead of latest (0.8.0) - we shall work with andLinux, not to play.

Memory size - 256MB RAM (or maybe more - if you can afford it).

Install XMing server on your primary screen.

Sound - you can enable or disable sound in Linux option - it is harmless although it is one more running server.

Startup type + Panel - select "run andLinux automatically as a NT service" + "use Windows shortcuts"; It is not very important, but can save you a little manual work and troubles later.

andLinux login - just select your user name and password for Linux root.

Windows File Access - it is important! - select "using CoFS", no matter it is not recommended.

File Access Using CoFS - important! - create one new directory somewhere and select it to be mount via CoFS. This will be the shared directory, visible from Windows and from Linux in the same time.

All other features you can choose freely or simply leave them to default state.

When you start installation, the installer will try to install network driver. It is possible Windows will protest and will atempt to mislead you by asking to not install not certified driver. You must ignore these attempts and firmly click "install".

After the installation of andLinux, you have to restart Windows and probably andLinux will not run. :)

It is because of the Windows firewall. All new network adapters are firewalled by default. As long as installed adapter (named TAP-Colinux) is virtual and local, you will not need any firewall, so, go to "Control panel/Windows firewall/Advanced" and uncheck "TAP-Colinux" adapter from the list of adapters.

Then you can run some Linux program - in the Windows tray, there is a andLinux menu icon that have shortcuts to several Linux programs.

1.3. Additional tools

Install several additional Linux tools. You will need additionally debugger and some decent terminal emulator. I choose xterm for terminal, because it is small and white by default. ;)

You can choose to use the built-in terminal named in the simple Linux manner: "xfce4-terminal" and console debugger "gdb". In this case you can skip this step because these tools are already installed.

Start "Synaptic" - package manager for Ubuntu from the tray menu. You have to enter root password you choose on install.

When Synaptic is started, click "Reload" to refresh the package list from the network and then use search to locate needed programs. I personally recommend "xterm" as terminal and "ddd" as a GUI front end to "gdb".

Well, I recommend "ddd" only because it is only Linux debugger that I was able to run under andLinux and able to show disassembled code of the program.

Mark selected programs for install, click on Apply button and wait until downloading and installation.

Here you can encounter only one problem - your computer is behind a proxy server.

If the proxy is a normal proxy, you simply have to set its address and port in the Synaptic preferences and it should work.

Completely another story is when the proxy is MS ISA server configured with NTLM user authorization.

Most Linux programs can't work with such authorization and Synaptic is not an exception.

Fortunately, there is a workaround of this situation. You need ntlmaps authorization proxy server.

Setting up of this server is out of the scope of this article. On the ntlmaps home page you can read complete documentation and explanations.

OK, we are ready with andLinux. Now you have working copy of Ubuntu inside your Windows box.

It's time to configure Fresh to run Linux applications inside andLinux. Continue with:

1.4. Fresh IDE configuration.

Run Fresh and open "Options|IDE options" dialog. Select "Debuggers and Emulators" page. Then select following directories and commands:

"andLinux directory" - the directory where you installed andLinux.

"andLinux shared directory" - shared directory you selected during andLinux installation.

"Linux debugger" - Enter "ddd" (or whatever debugger you choose).

"Linux terminal" - Enter: xterm -hold +mesg -e - the options are important.

And voila! You finished the configuration!

Now you can load the source of some Linux program (for example "Fresh/examples/XLib/XLib.fpr") and run it with shift+F9 or load it in the debugger with shift+F8.

Now Fresh IDE will detect when you compiled ELF executable and will run it in andLinux instead of Windows. Of course, the Windows applications will be treated as usually.

2. Linux setup

Working in Linux needs Wine installation. Fresh is tested with all version up to v1.7 and works great. You can skip the next step, if you already have Wine installed.

2.1. Install Wine

Install Wine - use whatever package manager is good for you. Synaptic is the usual choice. Fresh works good with default settings and does not need any additional work.

Nevertheless, it is better to un-check the option "wincfg|Graphics|Allow the window manager to decorate the windows" - this way the screen area will be better used.

Another possible issue are the installed fonts. The Fresh IDE default themes use MS fonts - "Courier New" and "Fixedsys". If these fonts are not installed, after installing Fresh, you must manually select suitable mono-spaced font from "Options|Editor options".

2.2. Install winetricks

Winetricks is a utility program that helps configuring Wine. Install it the same way you installed Wine in the previous step. Then from the console execute: winetricks allfonts in order to download and install all MS core fonts.

This step is because some Fresh IDE themes use MS fonts like "Courier New".

2.3. Configure Wine.

For better visual appearance, you may want to manually set some Wine settings. There are many online articles about this topic. The following link is to one of them: Improve GUI appearance of Wine applications. Make some Internet search for more information.

2.4. Install Fresh IDE

Install the latest Fresh IDE - you can use the installation package or ZIP archive. Simply run the installer as you do it in Windows.

Or unpack the ZIP archive in the directory you want.

2.5. Debuggers

Install whatever debugger you will use for Linux applications and OllyDbg for Windows applications. (OllyDbg works in Wine).

For Linux, personally I prefer EDB but any other is OK including mentioned in the previous chapter "ddd" and "gdb".

2.6. Configure Fresh IDE

Now you can run Fresh IDE and check whether the automatic settings are OK.

If the editor font is bad, select a suitable mono-spaced font from "Options|IDE options|Editor options" dialog.

Check the path aliases (environment variables) in "Options|IDE options" menu. If the auto configuration failed to set them properly, make it manually.

You will need at least following directory aliases: "Fresh", "finc" and "lib" - set them respectively to the Fresh main directory, Fresh "include" directory and "freshlib" directory, both located in Fresh main directory. (As a rule, there is an auto setup of these paths, so you don't have to make it manually. But sometimes the algorithm fails.)

In order to work with FASM examples and programs, or with your own macro libraries, you can set manually "include" or any other alias (environment variable) you prefer.

2.7. External tools

Set the paths to the external tools needed: (of course you have to install these tools in advance).

In "Options|IDE options|External tools" leave "andLinux directory" and "andLinux shared directory" fields empty. (they are not needed when Fresh runs in Linux)

Set "Linux debugger" field to binary file of the debugger you prefer. Add the needed options to the line as well.

For example, in my settings "Linux debugger" is set to z:/usr/bin/edb --run

Set "Linux terminal" to preferred terminal. For example z:/usr/bin/xterm -hold +mesg. Another example: z:/usr/bin/xfce4-terminal --hold -x

Set "Win32 external debugger" to OllyDbg. In my case: c:\Program files\OllyDebugger\Ollydbg.exe.

All paths must be "dos style" (Note: Wine maps Linux file system to device Z: ).

2.8. Test it

Try to compile and run some test applications both for Windows and Linux. Ctrl+F9 should compile, Shift+F9 should run the application and Shift+F8 should load it in the respective debugger. The type of the application should be automatically determined.

2.9. Additional tuning

You can create manually launchers on your desktop or/and start menu of your Linux distribution. For that purpose, in the main Fresh directory are placed two Fresh IDE icons - "Fresh.png" and "Fresh.svg".

For example, I use following launcher files in Linux Mint (it is automatically generated by the OS). Of course you have to set proper paths to the icon image and "Fresh.exe" executable.

[Desktop Entry] Type=Application Icon=/home/johnfound/.wine/drive_c/Fresh/Fresh.svg Name=Fresh IDE Categories=Development; Exec=wine "/home/johnfound/.wine/drive_c/Fresh/Fresh.exe" StartupNotify=true Terminal=false Name[en_US]=Fresh IDE Comment=<empty> Comment[en_US]=Visual assembly language IDE GenericName=Assembly language visual RAD IDE. Path=

2.10. Possible issues

2.10.1. Keyboard shortcuts conflicts.

In some Linux desktops, Fresh IDE keyboard shortcuts conflicts with the desktop manager global keyboard shortcuts. For example in Linux Mint the shortcuts Ctrl+Fn are assigned to switch the desktop workplaces.

This assignment will make Fresh IDE shortcuts to stop working properly. The only known workaround is to change Linux shortcuts, because the shortcuts of Fresh IDE can not be edited in this moment.

2.10.2. Font issues

During the first start, Fresh IDE tries to guess the proper font for the source editor. But in some rare cases, it fails to set proper font.

You can set your own font (fixed pitch) in "Options|IDE options|Editor options" dialog. Note that you can select proportional font as well, but the editor will not display it properly.

Use only mono-spaced or "almost mono-spaced" fonts - for example Fixedsys Excelsior is not actually mono-spaced, but is OK for Fresh editor. GNU Unifont is another such an example.

Last modified on: 18.10.2016 13:20:55

Preview

Title:

Filename:

User name:

Password: