kernel.o to link for window ?

General FreeBASIC programming questions.
Post Reply
Lionheart2020
Posts: 13
Joined: May 30, 2009 18:12

kernel.o to link for window ?

Post by Lionheart2020 »

dear freebasic friends, I say hello as a newbie ;)

my question to freebasic users or other nice folks here, how I can "link" a kernel.bas file under window ? "melf_i386" is good for linux, not for window, that's for sure my little problem. I have create a kernel.o (object file) with success, but after that it's impossible for me to link it for windows... do anybody has a good idea how to create this one ?

Code: Select all

'fbc -c kernel.bas
'ld -Ttext=0x100000 kernel.o -melf_i386 -o basic.krn

'# Linking
'ld -Ttext=0x100000 kernel.o -melf_i386 -o basic.krn

DIM video AS BYTE POINTER
DIM hello AS BYTE POINTER
 
video = CAST(BYTE POINTER, &Hb8000)
 
hello = strptr("Hello world")
 
WHILE *hello <> 0
    *video = *hello
    hello = hello + 1
    video = video + 2
WEND
 
DO : LOOP
 
CONST mb_magic = &H1BADB002
CONST mb_flags = 3
 
ASM
.global _start
_start:
    call fb_ctor__kernel
    jmp $
 
fb_RtInit:
    ret
 
mb_header:
    .align 4
    .int mb_magic
    .int mb_flags
    .int -mb_magic-mb_flags
END ASM
a warm and good sunny day to all,

cheerio, lionheart2020
Post Reply