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

Last change on this file since 4158 was 4158, checked in by Jean-Yves Lamoureux, 10 years ago
  • Fix indentation and add licensing and copyright headers to kernel
  • Property svn:keywords set to Id
File size: 1.6 KB
Line 
1/*
2 *  libcaca       
3 *  libcaca       Colour ASCII-Art library
4 *  Copyright (c) 2006 Sam Hocevar <sam@hocevar.net>
5 *                2009 Jean-Yves Lamoureux <jylam@lnxscene.org>
6 *                All Rights Reserved
7 *
8 *  $Id: kernel.c 4158 2009-12-20 14:02:02Z 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#include "config.h"
18#include "caca_types.h"
19
20#ifdef __KERNEL__
21
22#include "klibc.h"
23#include "boot/stage2.h"
24#include "kernel.h"
25#include "drivers/processor.h"
26#include "drivers/floppy.h"
27#include "drivers/timer.h"
28
29extern char const * const * caca_get_display_driver_list(void);
30
31/* C entry point, called from stage2 */
32int kmain(void)
33{
34    struct processor_info processor_info;
35    struct floppy_info    floppy_info;
36   
37    printf("_start at 0x%x\n", _start);
38    printf("kmain() at 0x%x\n", kmain);
39   
40    processor_get_info(&processor_info);
41    processor_print_info(&processor_info);
42
43    floppy_get_info(&floppy_info);
44    floppy_print_info(&floppy_info);
45
46    enable_interrupt(1);  // Enable Keyboard Interrupt (IRQ1)
47    enable_interrupt(0);  // Enable IRQ0 (timer)
48    enable_interrupt(13);
49    timer_phase(100);     // Fire IRQ0 each 1/100s
50   
51 
52    printf("Waiting 1s\n");
53    sleep(1);
54    printf("Waiting 2s\n");
55    sleep(2);
56    printf("Waiting 3s\n");
57    sleep(3);
58    printf("Ok\n");
59    //caca_get_display_driver_list();
60   
61   
62    while (1)
63    {
64       
65    }
66}
67
68
69#endif /* __KERNEL__ */
Note: See TracBrowser for help on using the repository browser.