source: libcaca/trunk/kernel/kernel.c @ 4154

Last change on this file since 4154 was 4154, checked in by Jean-Yves Lamoureux, 10 years ago
  • Total kernel rewrite
  • Property svn:keywords set to Id
File size: 1.8 KB
Line 
1/*
2 *  libcaca     
3 *  libcaca       Colour ASCII-Art library
4 *  Copyright (c) 2006 Sam Hocevar <sam@zoy.org>
5 *                2006-2009 Jean-Yves Lamoureux <jylam@lnxscene.org>
6 *                All Rights Reserved
7 *
8 *  $Id: kernel.c 4154 2009-12-20 13:33:11Z jylam $
9 *
10 *  This library is free software. It comes without any warranty, to
11 *  the extent permitted by applicable law. You can redistribute it
12 *  and/or modify it under the terms of the Do What The Fuck You Want
13 *  To Public License, Version 2, as published by Sam Hocevar. See
14 *  http://sam.zoy.org/wtfpl/COPYING for more details.
15 */
16
17/*
18 *  This file contains replacement functions for the standard C library
19 *  that must be used when building libcaca and libcaca into a kernel.
20 */
21
22#include "config.h"
23#include "caca_types.h"
24
25#ifdef __KERNEL__
26
27#include "klibc.h"
28#include "boot/stage2.h"
29#include "kernel.h"
30#include "drivers/processor.h"
31#include "drivers/floppy.h"
32#include "drivers/timer.h"
33
34extern char const * const * caca_get_display_driver_list(void);
35
36/* C entry point, called from stage2 */
37int kmain(void)
38{
39    struct processor_info processor_info;
40    struct floppy_info    floppy_info;
41   
42    printf("_start at 0x%x\n", _start);
43    printf("kmain() at 0x%x\n", kmain);
44   
45    processor_get_info(&processor_info);
46    processor_print_info(&processor_info);
47
48    floppy_get_info(&floppy_info);
49    floppy_print_info(&floppy_info);
50
51    enable_interrupt(1);  // Enable Keyboard Interrupt (IRQ1)
52    enable_interrupt(0);  // Enable IRQ0 (timer)
53    enable_interrupt(13);
54    timer_phase(100);     // Fire IRQ0 each 1/100s
55   
56 
57    printf("Waiting 1s\n");
58    sleep(1);
59    printf("Waiting 2s\n");
60    sleep(2);
61    printf("Waiting 3s\n");
62    sleep(3);
63    printf("Ok\n");
64    //caca_get_display_driver_list();
65   
66   
67    while (1)
68    {
69       
70    }
71}
72
73
74#endif /* __KERNEL__ */
Note: See TracBrowser for help on using the repository browser.