Permalink
Browse files

Merged modifications from my branch to trunk as requested by Zef. Thi…

…s includes asere patch with few modifications /bug fixes. Included JrCs coding standard name convention change. See CHANGES file for details.

git-svn-id: http://forge.voodooprojects.org/svn/chameleon/trunk@23 b5af796a-00a8-11df-919b-ffff7a100b7d
  • Loading branch information...
1 parent 4b1f1cd commit 0be02683f9e0dd7a80a54078f9a5cdc48f934112 rekursor committed Jan 21, 2010
Showing with 3,843 additions and 3,855 deletions.
  1. +15 −0 CHANGES
  2. +83 −0 coding_standards.txt
  3. +3 −0 doc/BootHelp.txt
  4. +1 −1 i386/boot0/boot0.s
  5. +2 −2 i386/boot2/Makefile
  6. +114 −155 i386/boot2/boot.c
  7. +69 −41 i386/boot2/boot.h
  8. +7 −7 i386/boot2/drivers.c
  9. +3 −41 i386/boot2/graphics.c
  10. +1 −3 i386/boot2/graphics.h
  11. +455 −504 i386/boot2/gui.c
  12. +61 −65 i386/boot2/gui.h
  13. +5 −5 i386/boot2/mboot.c
  14. +515 −594 i386/boot2/options.c
  15. +8 −8 i386/boot2/picopng.c
  16. +1 −1 i386/boot2/picopng.h
  17. +7 −10 i386/boot2/ramdisk.c
  18. +3 −3 i386/boot2/ramdisk.h
  19. +10 −3 i386/boot2/resume.c
  20. +5 −7 i386/libsa/efi_tables.c
  21. +2 −3 i386/libsa/efi_tables.h
  22. +38 −2 i386/libsa/libsa.h
  23. +0 −31 i386/libsa/strtol.c
  24. +11 −11 i386/libsa/zalloc.c
  25. +8 −6 i386/libsaio/Makefile
  26. +6 −0 i386/libsaio/SMBIOS.h
  27. +13 −4 i386/libsaio/acpi.h
  28. +0 −21 i386/libsaio/{memory.c → allocate.c}
  29. +406 −421 i386/libsaio/ati.c
  30. +0 −5 i386/libsaio/ati.h
  31. +74 −12 i386/libsaio/biosfn.c
  32. +0 −1 i386/libsaio/bootstruct.h
  33. +13 −11 i386/libsaio/console.c
  34. +167 −83 i386/libsaio/{freq_detect.c → cpu.c}
  35. +32 −0 i386/libsaio/cpu.h
  36. +17 −27 i386/libsaio/device_inject.c
  37. +5 −8 i386/libsaio/device_inject.h
  38. +4 −4 i386/libsaio/device_tree.c
  39. +4 −4 i386/libsaio/device_tree.h
  40. +47 −18 i386/libsaio/disk.c
  41. +74 −45 i386/libsaio/dsdt_patcher.c
  42. +3 −2 i386/libsaio/ext2fs.c
  43. +1 −1 i386/libsaio/ext2fs.h
  44. +233 −36 i386/libsaio/fake_efi.c
  45. +0 −77 i386/libsaio/freq_detect.h
  46. +5 −7 i386/libsaio/hfs.c
  47. +1 −1 i386/libsaio/hfs.h
  48. +2 −2 i386/libsaio/load.c
  49. +26 −0 i386/libsaio/mem.c
  50. +15 −0 i386/libsaio/mem.h
  51. +1 −49 i386/libsaio/misc.c
  52. +4 −5 i386/libsaio/msdos.c
  53. +3 −3 i386/libsaio/ntfs.c
  54. +1 −1 i386/libsaio/ntfs.h
  55. +209 −246 i386/libsaio/nvidia.c
  56. +83 −126 i386/libsaio/pci.c
  57. +15 −45 i386/libsaio/pci.h
  58. +118 −0 i386/libsaio/pci_root.c
  59. +13 −0 i386/libsaio/pci_root.h
  60. +11 −11 i386/libsaio/pci_setup.c
  61. +14 −65 i386/libsaio/platform.c
  62. +76 −67 i386/libsaio/platform.h
  63. +16 −14 i386/libsaio/saio_internal.h
  64. +3 −7 i386/libsaio/saio_types.h
  65. +460 −461 i386/libsaio/smbios_patcher.c
  66. +3 −0 i386/libsaio/smbios_patcher.h
  67. +4 −145 i386/libsaio/spd.c
  68. +4 −146 i386/libsaio/spd.h
  69. +61 −66 i386/libsaio/stringTable.c
  70. +119 −57 i386/libsaio/sys.c
  71. +44 −43 i386/libsaio/usb.c
  72. +6 −5 i386/util/machOconv.c
View
15 CHANGES
@@ -0,0 +1,15 @@
+- Added JrCs modified convention name change to coding_standards
+- Now malloc (ex. MALLOC in Asere patch) is renamed malloc(size) and is an alias
+ to safe_malloc(size, file, line) with _FILE_ and _LINE_ prerocessor definitions
+- Added a new 'Rename Partition Feature', now permitting to rename partition
+ like 'System reserved' to a more meaningful name
+- Added SystemID option permitting to change the System UUID to a fixed value.
+- Added the PciRoot autodetection feature imported from pcefi10.5
+- Added automatic "system-id" injection from dmi bios, also compatible
+ with SystemID boot option and former SMUUID from smbios,plist
+- Added "system-type' automatic injection (1=Desktop) plus override possibility
+ with the new system-type option in bootConfig
+- Added SMserial and SMproductname new options for smbios.plist
+- Merged with asere patch, while keeping my fake_efi.c changes, and adding a new
+ stringForKey() API, also changed the DT__XXXX() set of functions
+ to handle const char * values instead of char*.
View
@@ -0,0 +1,83 @@
+Coding Standard rev. 0 (First Draft)
+
+1. Indentation
+ having seen most indentation styles going from 2 to 8 spaces, I would suggest a indentation of 4 spaces.
+
+2. Comments
+I see here two main differents cases:
+function description comments and one-line code quite comments
+
+For functions documentation, I suggest to use this syntax
+/**
+ *
+ */
+Note the use of /** that will make future html auto-documentation easier (i.e: Doxygen at least recognize this marker)
+
+for punctual, short code comment, let's use:
+//
+3) #define at top of document
+4) Global vars right below #include / #define (notation: gLobal)
+Note that global vars and static vars should be avoided as much as possible in favor of local variables use, get/set functions (properties).
+
+5) No curly brackets for single lines
+
+6) else
+{
+ ....
+}
+
+instead of:
+
+else {
+ ....
+}
+
+7) if
+{
+ ....
+}
+instead of:
+
+if {
+ ....
+}
+
+8) fall through code (using indention) or bail out early (using returns)?
+Using early bail out for preconditions early in the function code,
+use common sense to avoid as an example more than 4 imbricated if() constructions.
+In the later case, consider decomposing your function in more manageable primitives.
+
+9) Spaces/readability i.e. not: if (fd<0)
+but: if (fd < 0)
+
+10. types, variables, functions, naming
+non const variables should follow the (currently mostly used) CamelCase convention:
+int myVariableIsFine;
+instead of :
+int my_variable_is_ok;
+
+Functions should follow the same conventions except for standard c lib related functions.
+Types should share the same convention but start with a Captial letter instead of lower case.
+
+11. Please make sure you extensively initialize variables:
+avoid as much as possible:
+int myVar
+...
+myVar = 10;
+
+but use instead:
+int myVar = 10;
+
+12. const values:
+const int MY_CONST_VARIABLE=42; is also ok for me, depending on the context of use.
+or
+const int MyConstVariable = 42; (with a Capital first letter)
+
+13. macro definitions should follow this convention:
+#define MY_HANDY_MACROS_PSEUDO_FUNC() ...
+
+14. Macros use should be limited to really special cases where they bring real value (like special optimization cases)
+Most of the time inlining a function is much better than the use of macros
+
+15. Don't optimize your code blindly, always favor readability when in doubt.
+Very often, optimization is not necessary where you think it is, think about the bubble sort algorithm, where people would code it in assembly, where a heap or quick sort algorithm would be much more efficient (n log(n) instead of quadratic complexity), as an example when values count to be sorted get high.
View
@@ -51,6 +51,9 @@ Options useful in the com.apple.Boot.plist file:
"Hide Partition" Remove unwanted partition(s) from the boot menu.
=hd(x,y) [hd(m,n)]
+ "Rename Partition" Rename partition(s) for the boot menu.
+ =hd(x,y) <alias>[;hd(m,n) <alias2> ...]
+
GUI=No Disable the GUI (enabled by default).
"Boot Banner"=Yes|No Show boot banner in GUI mode (enabled by default).
"Legacy Logo"=Yes|No Use the legacy grey apple logo (disabled by default).
View
@@ -55,7 +55,7 @@ DEBUG EQU 0
;
; Set to 1 to enable verbose mode
;
-VERBOSE EQU 1
+VERBOSE EQU 0
;
; Various constants.
View
@@ -59,9 +59,9 @@ MAXBOOTSIZE = 392704
all: $(DIRS_NEEDED) boot
embedtheme: CFLAGS += -DEMBED_THEME
-embedtheme: art.h embedded.h all
+embedtheme: art.h all
-boot: machOconv $(OBJS) $(LIBDEP)
+boot: machOconv embedded.h $(OBJS) $(LIBDEP)
$(LD) -static -Wl,-preload -Wl,-segaddr,__INIT,$(BOOT2ADDR) \
-nostdlib -arch i386 -Wl,-segalign,20 \
-o $(SYMROOT)/boot.sys $(filter %.o,$^) $(LIBS) -lcc_kext
Oops, something went wrong.

0 comments on commit 0be0268

Please sign in to comment.