You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

75 lines
1.8 KiB

  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$
  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. * This file contains replacement functions for the standard C library
  18. * that must be used when building libcaca and libcaca into a kernel.
  19. */
  20. #include "config.h"
  21. #include "caca_types.h"
  22. #ifdef __KERNEL__
  23. #include "klibc.h"
  24. #include "boot/stage2.h"
  25. #include "kernel.h"
  26. #include "drivers/processor.h"
  27. #include "drivers/floppy.h"
  28. #include "drivers/timer.h"
  29. extern char const * const * caca_get_display_driver_list(void);
  30. /* C entry point, called from stage2 */
  31. int kmain(void)
  32. {
  33. struct processor_info processor_info;
  34. struct floppy_info floppy_info;
  35. printf("_start at 0x%x\n", _start);
  36. printf("kmain() at 0x%x\n", kmain);
  37. processor_get_info(&processor_info);
  38. processor_print_info(&processor_info);
  39. floppy_get_info(&floppy_info);
  40. floppy_print_info(&floppy_info);
  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. printf("Waiting 1s\n");
  46. sleep(1);
  47. printf("Waiting 2s\n");
  48. sleep(2);
  49. printf("Waiting 3s\n");
  50. sleep(3);
  51. printf("Ok\n");
  52. //caca_get_display_driver_list();
  53. while (1)
  54. {
  55. }
  56. }
  57. #endif /* __KERNEL__ */