Showing posts with label Mac OSX. Show all posts
Showing posts with label Mac OSX. Show all posts

Saturday, July 12, 2014

How to speed up Eclipse?

Speeding Up Eclipse on Mac OSX


Wednesday, June 25, 2014

How to fix the /dev/fd/63: No such file or directory?

How to fix "diff: can't stat '/dev/fd/63': No such file or directory" error:

As root, simply run this command in your Terminal:

ln -s /proc/self/fd /dev/fd

Tuesday, June 10, 2014

How to reset file indexing on Mac OS X?

Reset File Index with Spotlight:

Open your Terminal:

sudo mdutil -i off /
sudo mdutil -E /
sudo mdutil -i on /

Saturday, November 9, 2013

Friday, July 19, 2013

How to compile HelloWorld in Intel x86-32 on Mac OSX/FreeBSD

How to compile HelloWorld in Intel x86-32 on Mac OSX/FreeBSD

Compile in your Terminal:
nasm -o hello.tmp -f macho hello.s && ld -arch i386 -macosx_version_min 10.6 -no_pie -e _main -o hello.o hello.tmp && ./hello.o

The Code:
section .data                   ; constants stored here

    msg db "Hello World!", 0xa  ; our string to be printed
    len equ $ - msg             ; get the length of our string

section .text                   ; labels stored here

global _main                    ; specify our main function - (ld -e main)

_syscall:                       ; label - system call - call kernel - how we print to the screen
    int 0x80
    ret

_main:                          ; label - technically int main()
    push    dword len           ; message length
    push    dword msg           ; message to write
    push    dword 1             ; file descriptor - 1 - stdout
    mov     eax, 0x4            ; system call number - 4 - system write
    call    _syscall            ; go to label(function call) - _syscall

    ;  add     esp,12          ;clean stack (3 arguments * 4)

    push    dword 0             ; exit code - return 0
    mov     eax, 0x1            ; system call number (sys_exit)
    call    _syscall            ; go to label(function call) - _syscall

Find more here:
https://github.com/jaredsburrows/Assembly