[Prev][Next][Index][Thread]

sleep function



Hello,
I have installed OSKit-20000505 on my Intel Pentium PC box
by the following way

    $configure  --with-perl=/usr/bin
    $make
    $make install

My environment is GNU/linux with 2.2.12 kernel, glibc 2.2, gcc 2.95.1.
I compiled "hello world" example without any problem. It works.
Then I wrote my simple kernel:

#include <oskit/clientos.h>
#include <oskit/c/stdio.h>
#include <oskit/c/unistd.h>

int print_bootstatus(int argc, char **argv) {

 extern char **environ;
 unsigned i;

 printf("\nI was given this command line, environment, and
bootopts:\n");
 for (i = 0; i < argc; i++)
  printf("  argv[%d]: `%s'\n", i, argv[i]);
 for (i = 0; environ[i]; i++)
  printf("  environ[%d]: `%s'\n", i, environ[i]);
 for (i = 0; i < oskit_bootargc; i++)
  printf("  oskit_bootargv[%d]: `%s'\n", i, oskit_bootargv[i]);

 multiboot_info_dump(&boot_info);

 printf("\nI'm running on a...\n");
 cpu_info_dump(&base_cpuid);

 return 0;
}

int main(int argc, char **argv)
{
 unsigned int slept;

 oskit_clientos_init();

 printf("Welcome to The OSKit-20000505\n");

 slept=sleep(10);

 if(slept==0) {
         print_bootstatus(argc,argv);
 }
 else {
     printf("error: slept=%d\n",slept);
 }

 return 0;
}

And I compiled it by

#!/bin/bash

gcc -c -o main.o -DOSKIT -MD   -DOSKIT_X86 -DOSKIT_X86_PC
-I/usr/local/include  -nostdinc -Wall -fno-strict-aliasing   main.c

ld -Ttext 100000  -L/usr/local/lib \
 -o myImage /usr/local/lib/oskit/multiboot.o main.o \
 -loskit_clientos -loskit_kern -loskit_lmm \
 -loskit_c /usr/local/lib/oskit/crtn.o

/usr/local/bin/mkmbimage myImage


When I ran my kernel installed on its own partition
via GRUB I found that sleep function does not work.
It always returns 10. My question is how to get working
sleep function. By the way, where can I find documentation
about liboskit_startup.a library?


Thanks in advance,
Andrew Lipnitsky.


Follow-Ups: