build.ck 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /*++
  2. Copyright (c) 2014 Minoca Corp. All Rights Reserved
  3. Module Name:
  4. BIOS UEFI Firmware
  5. Abstract:
  6. This module implements a UEFI-compatible firmware layer on top of a
  7. legacy PC/AT BIOS.
  8. Author:
  9. Evan Green 26-Feb-2014
  10. Environment:
  11. Firmware
  12. --*/
  13. function build() {
  14. plat = "bios";
  15. text_address = "0x100000";
  16. sources = [
  17. "acpi.c",
  18. "bioscall.c",
  19. ":" + plat + "fwv.o",
  20. "disk.c",
  21. "debug.c",
  22. "fwvol.c",
  23. "intr.c",
  24. "main.c",
  25. "memmap.c",
  26. "timer.c",
  27. "video.c",
  28. "x86/entry.S",
  29. "x86/realmexe.S"
  30. ];
  31. includes = [
  32. "$//uefi/include"
  33. ];
  34. sources_config = {
  35. "CFLAGS": ["-fshort-wchar"]
  36. };
  37. link_ldflags = [
  38. "-nostdlib",
  39. "-static"
  40. ];
  41. link_config = {
  42. "LDFLAGS": link_ldflags
  43. };
  44. common_libs = [
  45. "//uefi/core:ueficore",
  46. "//kernel/kd:kdboot",
  47. "//uefi/core:ueficore",
  48. "//uefi/archlib:uefiarch",
  49. "//lib/fatlib:fat",
  50. "//lib/basevid:basevid",
  51. "//lib/rtl/base:basertlb",
  52. "//kernel/kd/kdusb:kdnousb",
  53. "//uefi/core:emptyrd",
  54. ];
  55. libs = [
  56. "//uefi/dev/ns16550:ns16550"
  57. ];
  58. libs += common_libs;
  59. platfw = plat + "fw";
  60. elf = {
  61. "label": platfw + ".elf",
  62. "inputs": sources + libs,
  63. "sources_config": sources_config,
  64. "includes": includes,
  65. "config": link_config
  66. };
  67. entries = executable(elf);
  68. //
  69. // Build the firmware volume.
  70. //
  71. ffs = [
  72. "//uefi/core/runtime:rtbase.ffs",
  73. "//uefi/plat/bios/runtime:" + plat + "rt.ffs"
  74. ];
  75. fw_volume = uefi_fwvol_o(plat, ffs);
  76. entries += fw_volume;
  77. flattened = {
  78. "label": platfw,
  79. "inputs": [":" + platfw + ".elf"]
  80. };
  81. flattened = flattened_binary(flattened);
  82. entries += flattened;
  83. return entries;
  84. }
  85. return build();