Wednesday, June 29, 2011

Bad luck with my xbox360

Hi,

For those who don't know me, I have been a tinkerer since my childhood, the first memories i have of this trait of mine is of opening my Leo toy gun and an unfortunate alarm clock, the toy gun i had to throw away and alarm clock was placed behind a cupboard, had to destroy the evidence, but was caught both times by my parents.

Since then I have opened mp3 players, FM radio's, CD players, floppy drives, DVD drives, my CPU, Television ... the list goes on......

I own a XBOX360 , courtesy of my better half and that was the thing which was left unopened , mocking me , sitting smugly , as a challenge , an unconquered frontier. Not anymore :)

Although the mission was not a total success as I wanted to flash my xbox to be able to play backed up games ( you know what i mean ), but my xbox has liteon DVD drive , model number DG-16D2S-(09C), firmware number 93450C, which unfortunately has to be flashed by soldering a wire onto it, and I am not great with soldering, so I wisely decided to back off.

Have repacked the xbox and tested it, its running fine. Here is the pics of the adventure i had.




Regards,
Ishan

Wednesday, June 15, 2011

using makefiles to compile objective-c

Hi,

In the last post i have discussed the procedure of installing the GNUstep compiler on a windows machine and using it to compile the objective-c code.

But as you all must have felt that the procedure for compiling the code was a bit tedious and raw, so here is the make file version of compilation as promised in the last post.

Create a file named "makefile" and into that file put the following lines:

first : first.m
gcc -o first.exe first.m -I /C/GNUstep/GNUstep/System/Library/Headers \
-L /C/GNUstep/GNUstep/System/Library/Libraries \
-lobjc -lgnustep-base -fconstant-string-class=NSConstantString


Then on the GNUstep shell , make sure you are in the same folder as your source and makefile , type the command "make" and hopefully you will get the error free result.

Hope this makes the process a bit easy.

Regards,
Ishan

Thursday, June 9, 2011

Objective-c on windows

Objective-c is a nicely designed language with a rich feature set, If you are aware of the recent history of programming, you will know that when steve jobs was booted out of Apple he founded NeXT, a company which created the NeXT workstations. He licensed objective-c from "StepStone" the original creators of the language.

Due to its brilliant features objective-c became the prefered platform of hardcore programmers. Then Apple bought NeXT and objective-c became a part of what came to be known as Mac OSX.

Today objective-c is the language of preference if you want to develop on Mac, Although because of the premium tag associated with Mac's its out of reach for many people.

If you want to start learning objective-c as a language before jumping on to the Apple bandwagon, there is a solution.

The blessed GNU people created an open source implementation of the objective-c compiler and called it GNUstep and guess what , its available on windows.

You can download the required tools from the link given below.

http://www.gnustep.org/experience/Windows.html

Download the four tools provided from the links available on the page and install them in the suggested order.

GNUstep MSYS System -> GNUstep Core ->GNUstep Devel -> Cairo Backend.

After the installation is done from the windows start menu open the GNUstep shell, remember its very important to get start the GNUstep shell , if you will try to program in objective-c from the dos shell it will fail.

Opening the shell opens up a bash like interface, those people familiar with the linux command line will be comfortable here, all your favourite tools like Vim , make are avialable.

Create a new directory using the command : mkdir dirName.
Go into that directory using the command : cd dirName.

now create a new source file using Vim.
vim filename.m

Notice the weird extention of the source file we just created, well thats the standard extention for the source files containing objective-c code.

In the newly created source file write the following code.

#import <Foundation/Foundation.h>
int main (int argc
, const char *argv[])
{
NSLog (@
"Hello, Objective- C!");
return (0);

}

Now to compile the code there are 3 options:

1. compile directly using gcc
2. create a standard makefile and use the provided make utilty
3. use the GNUstep make utility

In this post i am going to cover only the first option.

To compile using gcc directly just use the following command:

gcc -o output fileName.m -I/c/GNUstep/GNUstep/System/Library/Headers \

-L /c/GNUstep/GNUstep/System/Library/Libraries -lobjc -lgnustep-base \

-fconstant-string-class=NSConstantString


An executable file , output.exe will be created in the present working directory.

To execute it just write ./output.exe on the command prompt.


I will try and cover the makefile and GNU make methods of compiling as they are more practical and basically cooler to work with.


Till then enjoy the Mac goodness on your Pc.


Regards,

Ishan