linux.init-ppc.S 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * GRUB -- GRand Unified Bootloader
  3. * Copyright (C) 2012 Free Software Foundation, Inc.
  4. *
  5. * GRUB is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * GRUB is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #define SYSCALL_WRITE 4
  19. #define SYSCALL_RESET 88
  20. #define SYSCALL_EXIT 1
  21. #define STDOUT 1
  22. #define SHUTDOWN_MAGIC1 0xfee1dead
  23. #define SHUTDOWN_MAGIC2 0x28121969
  24. #define SHUTDOWN_MAGIC3 0x4321fedc
  25. .text
  26. .global start, _start, __start
  27. __start:
  28. _start:
  29. start:
  30. /* write. */
  31. li %r0, SYSCALL_WRITE
  32. li %r3, STDOUT
  33. lis %r4, message@h
  34. ori %r4, %r4, message@l
  35. lis %r5, messageend@h
  36. ori %r5, %r5, messageend@l
  37. sub %r5, %r5, %r4
  38. sc
  39. /* shutdown. */
  40. li %r0, SYSCALL_RESET
  41. lis %r3, SHUTDOWN_MAGIC1@h
  42. ori %r3, %r3, SHUTDOWN_MAGIC1@l
  43. lis %r4, SHUTDOWN_MAGIC2@h
  44. ori %r4, %r4, SHUTDOWN_MAGIC2@l
  45. lis %r5, SHUTDOWN_MAGIC3@h
  46. ori %r5, %r5, SHUTDOWN_MAGIC3@l
  47. sc
  48. /* exit(1). Shouldn't be reached. */
  49. li %r0, SYSCALL_EXIT
  50. li %r3, 1
  51. sc
  52. .data
  53. message:
  54. .ascii "Boot Test Passed Successfully\n" SUCCESSFUL_BOOT_STRING "\n"
  55. messageend: