From: David LONY <david.lony@pragmadev.com>
To: caml-list@yquem.inria.fr
Subject: Multiboot problem
Date: Mon, 14 Jan 2008 11:03:11 +0100 [thread overview]
Message-ID: <478B335F.4050804@pragmadev.com> (raw)
Hi all,
I'm currently trying to make a multiboot sector with ocaml code.
Unfortunately, it doesn't work bu I don't know why...
To do that, I made a small program in ocaml :
let test_char a = a+1
let _ = Callback.register "caml_test_char" test_char;;
I also made a dummy libc (all functions return 0 or NULL pointer)
because I have to provide all these functions if a wants to statically
link a C objects..
This is my main file with the entry point of the kernel :
/* Include definitions of the multiboot standard */
#include <multiboot.h>
#include <x86_videomem.h>
#include <caml/mlvalues.h>
#include <caml/callback.h>
/* This is the entry point of the kernel */
void sos_main(unsigned long magic, unsigned long addr)
{
static char * argv[]={ "ocaml", NULL };
multiboot_info_t *mbi;
/* Retrieve grub information (memory...etc) */
mbi = (multiboot_info_t *) addr;
caml_startup(argv);
/* Clean the screen and put a 'A' on it */
sos_x86_videomem_setup();
sos_x86_videomem_cls(SOS_X86_VIDEO_BG_BLACK);
sos_x86_videomem_putchar(1, 0, SOS_X86_VIDEO_FG_WHITE |
SOS_X86_VIDEO_BG_BLACK,'A');
/* An operatig system never ends */
for (;;)
continue;
return;
}
But qemu freezes when I call the caml_startup function (If I removed it,
it works well...)...Perhaps the caml_startup function relies on C
function that I don't implements ?
If someone have an idea.... Because I must call this function
(caml_startup) in order to call my ocaml function (test_char)...
Thanks a lot.
Regards,
David LONY
next reply other threads:[~2008-01-14 9:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-14 10:03 David LONY [this message]
2008-01-14 13:24 ` [Caml-list] " David LONY
2008-01-14 15:06 ` Eric Cooper
2008-01-24 16:04 ` David LONY
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=478B335F.4050804@pragmadev.com \
--to=david.lony@pragmadev.com \
--cc=caml-list@yquem.inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox