Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

70 linhas
1.6 KiB

  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$
  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. #include "config.h"
  17. #include "caca_types.h"
  18. #ifdef __KERNEL__
  19. #include "klibc.h"
  20. #include "boot/stage2.h"
  21. #include "kernel.h"
  22. #include "drivers/processor.h"
  23. #include "drivers/floppy.h"
  24. #include "drivers/timer.h"
  25. extern char const * const * caca_get_display_driver_list(void);
  26. /* C entry point, called from stage2 */
  27. int kmain(void)
  28. {
  29. struct processor_info processor_info;
  30. struct floppy_info floppy_info;
  31. printf("_start at 0x%x\n", _start);
  32. printf("kmain() at 0x%x\n", kmain);
  33. processor_get_info(&processor_info);
  34. processor_print_info(&processor_info);
  35. floppy_get_info(&floppy_info);
  36. floppy_print_info(&floppy_info);
  37. enable_interrupt(1); // Enable Keyboard Interrupt (IRQ1)
  38. enable_interrupt(0); // Enable IRQ0 (timer)
  39. enable_interrupt(13);
  40. timer_phase(100); // Fire IRQ0 each 1/100s
  41. printf("Waiting 1s\n");
  42. sleep(1);
  43. printf("Waiting 2s\n");
  44. sleep(2);
  45. printf("Waiting 3s\n");
  46. sleep(3);
  47. printf("Ok\n");
  48. //caca_get_display_driver_list();
  49. while (1)
  50. {
  51. }
  52. }
  53. #endif /* __KERNEL__ */