startup.S 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * GRUB -- GRand Unified Bootloader
  3. * Copyright (C) 1999,2000,2001,2002,2003,2005,2006,2007,2008 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. #include <grub/symbol.h>
  19. #include <grub/offsets.h>
  20. #include <multiboot.h>
  21. #include <multiboot2.h>
  22. /*
  23. * Note: GRUB is compiled with the options -mrtd and -mregparm=3.
  24. * So the first three arguments are passed in %eax, %edx, and %ecx,
  25. * respectively, and if a function has a fixed number of arguments
  26. * and the number if greater than three, the function must return
  27. * with "ret $N" where N is ((the number of arguments) - 3) * 4.
  28. */
  29. .file "startup.S"
  30. .text
  31. .globl start, _start
  32. start:
  33. _start:
  34. movl %eax, EXT_C(grub_ieee1275_entry_fn)
  35. jmp EXT_C(grub_main)