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

Last change on this file since 4159 was 4159, checked in by Jean-Yves Lamoureux, 10 years ago
  • Added 64bits RDTSC support, as well as CPU frequency guess (more like a 8254a test, actually)
  • Property svn:keywords set to Id
File size: 1.7 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 4159 2009-12-20 15:41:41Z 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    printf("Types : char[%d] int[%d] long[%d] unsigned long long[%d]\n", sizeof(char), sizeof(int), sizeof(long), sizeof(unsigned long long));
40   
41    enable_interrupt(1);  // Enable Keyboard Interrupt (IRQ1)
42    enable_interrupt(0);  // Enable IRQ0 (timer)
43    enable_interrupt(13);
44    timer_phase(100);     // Fire IRQ0 each 1/100s
45   
46   
47    processor_get_info(&processor_info);
48    processor_print_info(&processor_info);
49
50    floppy_get_info(&floppy_info);
51    floppy_print_info(&floppy_info);
52
53    //caca_get_display_driver_list();
54    printf("Entering kernel infinite loop.\n");
55   
56    while (1)
57    {
58       
59    }
60}
61
62
63#endif /* __KERNEL__ */
Note: See TracBrowser for help on using the repository browser.