forked from mfleming/bits
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NEWS.txt
2123 lines (1540 loc) · 81.7 KB
/
NEWS.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
bits-1084
=========
- efi: Implement comparisons on GUIDs properly, including comparisons with
UUIDs
Fixes an exception in smbios and mptable on EFI systems when doing
GUID lookups.
- mkpresent: Work around bug in pdftoppm with rotated PDFs
If the generated image has width and height transposed, rerun pdftoppm
with transposed input values.
bits-1081
=========
The "ctypes. ctypes run. run types run" release.
This release introduces preliminary support for the Python ctypes module
in EFI builds. This includes the initial infrastructure to compile
libffi as part of BITS.
ctypes data types, ctypes structures, and read/write access to memory
work. This replaces many uses of bits.memory, struct.pack,
struct.unpack, and the BITS unpack module. In particular, the use of
ctypes data types and structures allows round-trip conversions from
structures in memory to Python data types and back, generally without
making copies.
This initial implementation provides enough support for all the data
structures in the efi module, which has now completely switched over to
ctypes-based data types and structures.
Notable limitations:
- No support for non-EFI builds yet, because GRUB uses stdcall and
regparm=3 for PC BIOS builds, which libffi does not support on
non-Windows systems.
- Function calls to EFI functions still require efi.call; the
ctypes-based FFI does not yet work, as it does not understand the EFI
calling convention.
- dlopen does not work, so there's no way to obtain pointers to existing
C functions to call.
Note that to support this change, the version of Python built into BITS
now internally uses UTF-16 (2-byte characters) rather than UCS-4 (4-byte
characters), to match EFI. This allows the use of the ctypes functions
for the C wchar_t type, rather than hand-rolled functions for two-byte
Unicode. Python still has full support for all of Unicode, including
characters outside the Basic Multilingual Plane; this just changes the
internal representation. However, attempting to use characters outside
the BMP in EFI calls may or may not work, depending on your firmware;
your mileage may vary.
This release also introduces support for reading and writing files using
EFI. On EFI systems, BITS now has full support for writing arbitrary
files to a FAT filesystem. The new efi.get_boot_fs() function will
retrieve the filesystem BITS booted from, as an efi_file, a new Python
file-like object. In addition to the usual file methods, an efi_file
provides methods to open and create files and directories. For example:
import efi
root = efi.get_boot_fs()
newdir = root.mkdir("newdir")
newfile = newdir.create("newfile")
newfile.write("Hello world!\n")
Or, chaining the calls together (convenient for command-line usage):
efi.get_boot_fs().mkdir("newdir").create("newfile").write(data)
The new functions `acpi.efi_save_tables()` and `efi.save_tables()` use
this new filesystem write capability to save copies of ACPI and EFI
tables, for later inspection.
Note that EFI firmware typically only supports FAT filesystems, not
iso9660 (the filesystem used on optical media). The BITS .iso images,
even when imaged to a USB disk, keep most of their files in an iso9660
filesystem, with the exception of a small FAT filesystem used to store
GRUB itself as an EFI binary. Thus, get_boot_fs() will not produce the
expected results when booting from an optical disc or from a disk
created from a BITS .iso; for full read/write support, create a
FAT-based BITS disk, following the procedure in INSTALL.txt.
This release adds support for many new EFI protocols:
- efi: Add read/write file support using FileProtocol, including a
file-like object
The efi_file wrapper includes the standard Python file-like methods
(read, write, seek, tell, close, flush), EFI-specific properties
(file_info, file_system_info, volume_label) and methods (delete), and
methods to create or open another efi_file relative to a directory
(open, create, mkdir).
Also add a definition of the EFI SimpleFileSystemProtocol to open a
block device, with a "root" property to get the root directory as an
efi_file.
Add a get_boot_fs() function to return the filesystem BITS booted
from, obtained via the DeviceHandle of the LoadedImageProtocol on the
image handle. Useful as the root for writing files.
- efi: Add DevicePathProtocol and DevicePathToTextProtocol
DevicePathToTextProtocol includes helpers to transform the returned
paths into Python unicode strings, and then free the original memory.
- efi: Add LoadedImageProtocol
Other changes in this release:
- python: Support the zlib module
- bits.present, mkpresent: Use zlib to compress and decompress slide images
Provides an order of magnitude improvement to disk usage and load time.
- acpi: Add an efi_save_tables utility function to save ACPI tables to files
As the name suggests, this function only works on EFI, since it uses the
EFI file write support.
In addition to the binary dumps, this also includes text decodes of
selected structures, and enough address information to recreate the
tables in memory.
- efi: Add a function efi.save_tables() to save the core EFI tables to files
- efi: As a workaround for limitations in the internal EFI function call
interface, add a compatibility layer for 64-bit arguments on 32-bit
platforms. Wrap 64-bit arguments in efi.split64(), and they will
automatically be split into pairs of 32-bit arguments on 32-bit
platforms, for compatibility with the current efi.call interface.
- Add EFI tests. The first round of tests verifies the CRCs of the core
EFI tables.
- efi: Add a base class for EFI protocols
Protocols are ctypes structures with an associated GUID; they provide
a .from_handle classmethod to get the protocol from an EFI handle (via
OpenProtocol) and wrap it in the protocol class.
- efi: Add more known UUIDs
- efi: When printing structures, format pointers and unsigned types as
hex, and list out the contents of arrays.
- efi: Various new helper functions:
- Add a helper function check_status to throw an exception for !=
EFI_SUCCESS
- Add a helper check_error_value to handle non-status return values.
Some EFI functions return a non-status return value, but still use
the EFI_ERROR bit to indicate an error. Add a helper that checks
only that bit, and otherwise returns the value for subsequent use.
- Add a locate_handles helper to call LocateHandle with a given GUID.
This helper handles the two-pass memory allocation, and returns a
ctypes array of handles.
- Add helper functions to compute table CRC32 values. These compute
the CRC32 as if the table's CRC32 field is 0, and then compare the
result to the table's actual CRC32 field.
- Add a helper function efi.to_bytes to convert a ctypes structure to
raw bytes
- README.Developers.txt: Document Python patches for ctypes and libffi
bits-1048
=========
This release introduces a new bits.* Python module namespace for new modules,
to keep the module namespace more contained:
- python: Move bits to bits/__init__.py to allow modules under bits.*
- python: Split pyfs functions out of bits into their own module, bits.pyfs
- python: Split pause() into a separate bits.pause module to avoid a circular
reference
bits imported redirect for redirect.nolog(), for use in pause(), and
redirect imports bits, creating a circular reference. Split pause()
into its own module, bits.pause, to break that cycle.
- Add new bits.pirtable module to find, parse, and test the PCI Interrupt
Routing ($PIR) table
Other changes in this release:
- Add bits.present, a module for giving a presentation using EFI GOP
- Add mkpresent, a script to generate slide images for bits.present
- readline: Add a mechanism to hook function keys and call arbitrary functions
- build: Support building local files into the .iso
Useful for local testing; avoids the need to construct and subsequently
modify a writable USB disk.
- mptable: Support finding the MP Table on EFI via configuration table GUID
- smbios: Support finding the SMBIOS tables on EFI via configuration table GUID
- efi: Add known UUIDs for various protocols
- efi: Create named constants for known UUIDs
- efi: Add function to dump all protocols in use, using LocateHandleBuffer and
ProtocolsPerHandle
- acpi: Handle "local reference" objects
- acpi: Add test for parsing MPST
- mptable: Validate header length and checksum after finding an _MP_ signature
If the length isn't valid or the checksum doesn't match, keep searching.
- acpi: When displaying the RSDT or XSDT, decode the name of each table
A list of table pointers is...uninformative.
- acpi: Add a display_objects() function to show object types
get_objpaths just retrieves all the object names; display_objects
additionally shows the type of each object.
- ttypager: Add a context manager that sends all output through the pager
This avoids the need to manually accumulate a string and call ttypager
on it, and thus avoids creating duplicate versions of functions, one
with the pager and one without.
Note that all output is deferred until the context manager exits, and
the context manager captures all exceptions and displays the traceback
through the pager.
- acpi: Use the new ttypager context manager in display_resources
- ttypager: Make home and end keys move to beginning and end, respectively
- platform: Make cpuids and msrs iterable
Walking them produces the list of all known (non-generic) CPUID and MSR
decoded values.
- platform: Add a dump() function to show all CPUIDs and MSRs for all CPUs
- platform: Make platform.dump() display using the pager
- Add an explore menu option to show platform information via platform.dump()
- platformbase: Improve documentation printed with CPUID and MSR objects
Show the APIC ID and docstring for CPUIDs and MSRs.
- platformbase: Add a sanity check to MSRs to prevent instantiating the generic
MSR
The MSR class requires an MSR number, and does not set that MSR number
itself. Subclasses that decode specific MSRs must set that MSR number.
- python: Stop using Python 2.7 {set} notation, for 2.6 syntax compatibility
BITS is built using Python 2.7, but with this one change, the modules
are parseable using the Python 2.6 ast module, useful for running
analysis scripts from a host system.
Bugfixes:
- acpi: Fix structure alignment and padding for ObjectInfo on 64-bit
ACPI_PNP_DEVICE_ID contains an integer followed by a pointer, so it has
padding in the middle on 64-bit. The containing structure has an 8-byte
address which needs padding to an 8-byte boundary on 64-bit. Handle
both of those instances of padding.
- acpi.evaluate: Fix error handling when translating an object within a package
When converting an ACPI object to a Python object, an unknown ACPI
object type will set the Python exception and return NULL. However,
when that error occurred within a package, the caller would then add
that NULL to the package and continue, rather than propagating the
error. Fix the package-handling code to reclaim the tuple and propagate
the error further up.
- acpi: Fix unpacking of object info structure
Invalid strings still have both a length and offset to unpack, even
though the length is 0.
- python: redirect: Drop unused import of acpi
- testacpi: Fix typo in a test description
- python/msrs.py: Fix typo in an MSR name
bits-1007
=========
The "64 bits ought to be enough for anyone" release.
Add initial support for 64-bit EFI. A BITS .iso image will now boot as
either a disk image or CD image for any of 32-bit BIOS, 32-bit EFI, or
64-bit EFI. For updated installation procedures, see INSTALL.txt.
Add a GRUB patch to 16-byte align the stack for grub_main(). The x86-64
ABI requires a 16-byte-aligned stack, which GRUB did not provide. That
caused some crashes, notably when running some SSE instructions. Fix by
aligning the stack in assembly before calling grub_main().
Port SMP support to support running processors in 64-bit mode:
- Add CPU bringup code for 64-bit long mode. Port all remaining
assembly to 64-bit, and to the 64-bit ABI.
- Since long mode requires paging, pass the page-table pointer from the
BSP (as set up by the firmware) to the APs. Note that the current
approach to this will fail if the firmware relocates its page tables
above 4GB after its initial page table setup. Also note that since
all memory requires mapping via the page table, accessing memory not
mapped by the BSP page table (such as a wild pointer supplied by a
firmware structure or an adventurous tester) will trigger an unhandled
page fault and unceremoniously die.
- Increase the size of the SMP working memory to accomodate larger
data structures.
- Use a relative offset in the GPF handler, not an absolute offset; that
avoids the need for a 64-bit offset.
- Port IDT parsing and setup from assembly to C.
- Port many assembly functions to use inline assembly, eliminating their
calling-convention-specific prologue and epilogue code, to simplify
the 64-bit port, and make the assembly more maintainable (by having
less of it):
- cpuid
- pause
- I/O port read/write
- rdtsc
- cli and sti
- rdmsr
- wrmsr
- infinite loop
- lidt and sidt
- getting CS
- drop_ap_lock
- smp: Delete several bits of old unused code:
- Unused assembly functions
- Unused data structures
- Unused function prototypes
- The "real-mode callback" mechanism, once used to park CPUs before
booting an OS, but eliminated long ago by simply leaving the CPUs in
an mwait loop in memory reserved from the OS.
- A synchronization variable that the AP code no longer uses (a relic
of waking the APs up via SIPI each time we have code to run, rather
than waking them up once and putting them in an mwait loop waiting
for work to do).
- Code that allows the function called via SIPI to return, now unused
because we call a function that waits forever for work to do.
Numerous cleanups to make C code 64-bit clean:
- Use pointer types rather than integral types when appropriate.
- Fix pointer-size and integer-size assumptions.
- Fix printf format strings.
- Make Python interface code 64-bit clean. Use Py_BuildValue and
PyArg_ParseTuple 'k' conversions for pointers. Convert safely between
some ACPI always-32-bit "pointers" and native pointers, with bounds
checking. Consistently use "unsigned long" for an integer of the same
size as a pointer.
- Make various config defines and typedefs portable.
- Rewrite Python's file <-> fd mapping to support sizeof(int) != sizeof(FILE *)
Abstract FILE * <-> integer fd conversions into functions to make them
easier to replace and more maintainable.
- Handle overflow errors safely in fwrite()
- python: fdlibm: Explicitly define __LITTLE_ENDIAN
fdlibm autodetected __LITTLE_ENDIAN based on some compiler definitions
defined for 32-bit x86, but not for 64-bit x86. Define it explicitly to
bypass fdlibm's faulty autodetection.
Only one change to make the Python code 64-bit clean; thanks to the
wonders of a language with arbitrary-precision integers, the one and
only change involves parsing data structures supplied by the
(non-Python) firmware:
- efi: Parse the (completely undocumented) padding after
FirmwareRevision in system table
Update boot support and documentation:
- INSTALL.txt: Update installation instructions for EFI support
- build: Build and install EFI binaries
grub-mkrescue already creates EFI binaries and embeds them in the El
Torito disk image for the .iso; however, those are not easily accessible
for use when creating a writable disk image, and they don't include all
the necessary modules to support disks. Build images with a more
complete set of modules for disk support, and ship them in /efi/boot in
the BITS binary distribution.
- Add support for booting BITS .iso files as EFI disk images, via an
even more hybridized hybrid .iso format.
Introduces a dependency on xorriso 1.3.0 or newer, and backports several
grub-mkrescue changes from upstream GRUB.
- README.Developers.txt: Document that building the EFI image requires
mtools (grub-mkrescue invokes mtools to construct the EFI El Torito
disk image to embed in the .iso). The previous release introduced
this dependency but didn't document it.
Other changes in this release:
- _bits: Split out SMP and ACPI functions into separate _smp and _acpi
modules, making it easier to do incremental ports of _bits.
- Move test verbosity level entirely to Python
No tests use GRUB scripting anymore, so eliminate the test_verbose
environment variable, and move the test verbosity level entirely inside
the Python testsuite module.
- build: Enable parallel builds on all available CPUs
- efi: Expand variable-reading sample code to read and display variable values
Uses both GetNextVariableName and GetVariable.
Displays variable values as hex/ascii dumps, since they may (and usually
do) contain non-ascii data, and the interpretation depends on the
variable UUID and name.
- python: Implement assert() and make it actually assert.
GRUB's assert prints a message on assertion failure but then returns.
Abort instead.
Also support capturing and printing the assert expression.
- smp: Verify that the SIPI target code fits in the region allocated for it
The SIPI target code has to fit within the first 2k of the allocated
SIPI target page, minus the size of the data structure passed to APs.
Before expanding that code further, add a check to make sure it won't
silently start conflicting with the data structure.
- python: Move all the C/POSIX compatibility functions from inlines in
pyconfig.h to a separate source file
- testsuite: Remove the rdmem GRUB command
No GRUB scripts use this functionality, and Python scripts have equivalent
(and much more capable) functionality through bits functions.
- pstate: Handle processors without turbo when testing hardware P-states
- smilatency: Make the test variant that disables USB via BIOS handoff actually
disable USB via BIOS handoff
bits-945
========
Add initial support for 32-bit EFI.
BITS now builds GRUB and the BITS-specific GRUB modules for Python,
ACPICA, SMP, and other support modules for both 32-bit BIOS (i386_pc)
and 32-bit EFI (i386_efi), and constructs a .iso which boots both ways.
The resulting .iso successfully boots as a CD using KVM with OVMF, and
still boots as either a CD or hard disk on BIOS-based systems. Note
that the .iso does not support booting as a hard disk on EFI-based
systems.
On EFI platforms, Python's sys.platform now returns "BITS-EFI"; BIOS
platforms will continue to return "BITS". (Future 64-bit EFI support
will also use "BITS-EFI"; use bits.ptrsize to find the native size of a
pointer, and use the "P" type with the struct or unpack modules to pack or
unpack a native-sized pointer.)
On EFI, ACPICA finds the RSDP as an EFI configuration table rather than
via memory search.
BITS now provides an "efi" module with some preliminary interfaces to
access EFI data structures and call EFI functions. This module provides
all the functionality needed to find EFI interfaces by UUID and call
arbitrary EFI functions entirely from Python, without writing any new C
code. For example, to print an iconic greeting:
import bits, efi
greeting = efi.encode_UCS2_mem("Hello world!\r\n")
efi.call(efi.system_table.ConOut.OutputString,
efi.system_table.ConOut._addr,
bits.memory_addr(greeting))
The new efi module includes:
- The efi.call function seen above
- Helpers for buffer and UCS-2 Unicode string manipulation
- efi.system_table, a decoded version of the EFI system table and all
the structures and interfaces nested within it, including
BootServices, RuntimeServices, and ConIn/ConOut/StdErr.
- efi.print_variable_names, a larger code sample which demonstrates how
to retrieve, decode, and print the list of EFI variables using
GetNextVariableName
- efi.log_efi_info, a function now called at BITS init time to log basic
information about the EFI firmware, including the firmware vendor, the
firmware version, the UUIDs of supported configuration tables, and the
corresponding names for any recognized UUIDs.
Expect the efi module interface to change in future versions as the
support for calling EFI functions and decoding EFI data structures
becomes simpler and easier to use.
Note that EFI's default text input API doesn't support returning
Ctrl-characters, making many common line-editing keys unavailable, and
making the essential Ctrl-D keystroke to exit Python impossible; BITS
now accepts Escape as an alternative to Ctrl-D.
Other supporting infrastructure leading to EFI support:
- bits: Add bits.ptrsize, which contains the machine's native pointer
size (4 or 8)
- bits: Add bits.malloc to create a new buffer of a specified size
Through the wonders of garbage collection, there is no corresponding
bits.free.
- bits: Add a memmove function to manipulate memory directly
Needed to write buffer manipulation functions in Python rather than in
C.
- Add GRUB patch fixing EFI memory allocator page rounding
The EFI memory allocator rounded allocation sizes up to 1k boundaries
rather than 4k page boundaries.
- Add GRUB patch to support allocation below 1M in the EFI memory
allocator
Needed to allocate memory for an IPI handler.
- Add GRUB patch for EFI memory allocator memory type mapping
EFI's AllocatePages call will refuse attempts to allocate memory and
leave it marked as EfiConventionalMemory (free memory available for
subsequent allocations), so map requests for GRUB_MEMORY_AVAILABLE
into EfiLoaderCode rather than EfiConventionalMemory.
- smp: After attempting to allocate a page below 1M, verify its address
- smp: Allocate working memory with grub_memalign, not
grub_mmap_malign_and_register
On BIOS builds, the difference is harmless, but on EFI builds the
latter calls the firmware's AllocatePages rather than using GRUB's
internal memory allocator. Since we don't need to reserve the working
memory after OS boot, we don't need to use the firmware's memory
allocator.
- smp: Handle systems where the BSP already has an IDTR
On EFI, GRUB sets up a non-zero IDTR, rather than using the real-mode
one IDTR at address 0. Fix that code path to not attempt to "restore"
to a real-mode IDTR. Instead, save and restore the GPF handler in the
existing IDTR around the function call in smp_function.
- smbios: Gracefully handle systems without SMBIOS tables
- mptable: Handle systems that don't have an EBDA
On systems without an EBDA, the EBDA address in the BDA contains a 0;
handle that rather than searching at 0.
- smp: Find the MADT using acpica rather than searching for the RSDP in
memory
In addition to eliminating duplicate code, this allows smp to work on
EFI, which finds the RSDP as an EFI system table rather than through a
memory search.
- readline: Add Escape as an alternate EOF character, for when Ctrl-D
doesn't work
EFI's default text input API doesn't support returning
Ctrl-characters, making the essential Ctrl-D keystroke impossible; add
Escape as an alternative. Also improves compatibility with GRUB's own
command line, which uses Escape to return to the menu.
Other improvements:
- README.Developers.txt: Document that the lnxboot partition number
patch got merged upstream
GRUB merged the patch in bzr revno 5185.
- mptable: Check for the MP Floating Pointer Structure in a
non-spec-compliant location
Some BIOSes put the MP Floating Pointer Structure in the 0xE0000
block, rather than a spec-compliant location like the 0xF0000 block.
Search that block to find the table in that block, and add a test that
fails on such BIOSes.
- python: Split pyfs into a separate C module, _pyfs
- smbios: Add a blank line before printing the SMBIOS information to the
log
- smbios: Wrap each SMBIOS structure when printing
Build system improvements:
- build: Build from copies of the source directories, not the originals
The build procedures for GRUB and Python potentially leave byproducts
in the source directories. Rather than attempting to clean those up
afterwards, build from copies of the source and leave the originals
pristine. This then removes the need to clean the source trees both
before and after the builds.
The build procedure now verifies at the beginning that the source
directories appear pristine (no generated Makefile).
- Support out-of-tree GRUB builds: Use $(srcdir) or $(top_srcdir) as
appropriate when constructing include paths.
- Configuring and building the same GRUB source tree for two different
platforms fails without doing a clean in-between, so instead, do an
out-of-tree configure and build for each platform. (See below for
many other build system improvements.)
- build: Set CCACHE_BASEDIR so ccache works on the temporary source
copies
Normally, ccache will never hit if the path to the source or include
files changes; thus, copying all the source trees to a temporary
directory makes ccache always miss. Set CCACHE_BASEDIR to the root of
that temporary directory, so that ccache can still hit if the
remainder of the paths match.
- build: Copy grub modules manually rather than running grub-install
Rather than running grub-install to copy grub modules, and mocking up
all the other things it wants to do as no-ops, just copy the modules
manually.
Bugfixes:
- acpi: Fix improper access to number_system_localities field which
caused an exception.
- In generated menuentries, stop deleting modules after import.
- smp: Initialize working memory to 0
smp_init added a magic signature to its working memory, and checked
for that signature to see if it had already run; however, smp_init did
not clear its working memory after allocating it. On systems that
don't clear RAM on reboot, smp_init would allocate its working memory
at the same address each time, and would thus think it had initialized
when it hadn't, causing Bad Things to happen.
Fix by initializing working memory after allocation.
- acpica: Make acpica_init_state static
Nothing outside of acpica.c accesses acpica_init_state, so make it
static and drop it from acpica.h.
- bits: Make cpuid_result print all eight digits of its registers
Format using #010x, since the 0x counts as part of the length.
- testacpi: Fix typo in _PSD test
bits-910
========
- acpi: Add decode for all resource descriptors from ACPI _CRS and _PRS
methods.
- Add ability to discover, decode and display the MP Table.
- SMBIOS: Add SMBIOS decode and display to Explore menu.
- ttypager: ttypager can now detect redirect status and output to the
log file.
When redirect.log() is active, text sent to ttypager will be directed
to the log file first and then metered to the screen with no further
outputs to the log file. When redirect.nolog() is active, text sent to
ttypager will be directed to the log file first and then ttypager will
exit with no text sent to the screen.
ttypager module's ttypager method has been modified to check whether
redirect's log() or logonly() context managers are active and then to
direct all cached output to the log before metering text to the
screen. This allows ttypager to be used when the logonly() and log()
conext managers are actively limiting outputs.
The redirect module now has a module-level status indicating when the
log(), logonly(), or nolog() context managers are active.
- acpi: Add get_object_info() to get information from an ACPI namespace
object.
acpi.get_object_info() accepts an ACPI namepath and returns decoded
information using ACPICA's ACPIGetObjectInfo().
- acpi: Add decode for software licensing-related tables MSDM and SLIC
- menus: Discontinue deletion of imported Python modules used in menu
entries.
Deleting every module imported by Python menu entries impacts the
interactive python interpreter environment.
Only delete modules imported during BITS initialization, before the
Python interpreter is available.
- bits: Modify pause() method to only print the "Press any key..."
message to the screen.
- SMBIOS: Refactor SMBIOS class to move header fields into a separate
class.
- Bugfixes:
- Make CPU frequency detection fail gracefully in the absence of
APERF/MPERF
- Fix Python reference leaks caused by Py_BuildValue "O" on a
referenced object. Py_BuildValue's "O" type adds a reference to an
object, while "N" expects an already-referenced object. Fix memory
leaks caused by using "O" on an object that already has a reference.
- SMBIOS: Fix the type of enumerated_type in SystemEnclosure, which is
a bitfield, not a string.
- P-state test now uses the one detected processor when no APIC table
exists.
- Only check for Turbo if 2 or more P-states exist.
- PSD test now uses the new ACPI _PSD class.
bits-893
========
- Port BITS to GRUB 2.00
- Drop backported GRUB patches already included in 2.00.
- Forward-port our remaining GRUB patches, fix some new bugs in 2.00,
and update the patch list in README.Developers.txt accordingly.
- Update the build process to support the new build system, based on
autotools and autogen.
- Since GRUB no longer waits for user input after running a menu entry
unless an error occurred, add an explicit pause at the end of
entries using the GRUB pager, and add support to our pager to not
exit at the end of a file. This has the added bonus of allowing
backward scrolling after hitting the end of a file.
- Update readline and the pager for changes to GRUB's input interface.
Now supports reading keys and modifiers as a unit, avoiding
potential race conditions when reading them separately.
- Various updates to C code to adapt to new GRUB interfaces.
- Fix ACPICA portability interface for changes to GRUB.
- Fix some new warnings that GRUB now includes the flags for.
- Extensive additions, improvements, and bugfixes to the ACPI parsing
infrastructure. In particular:
- Add method result parsing and corresponding classes
In addition to cleaning up method handling, this paves the way for
tests of methods, which the previous decode-print-and-throw-away
approach did not support.
- Automatically generate the menu of ACPI methods
- Improve the Struct and Unpack infrastructure, and factor it out into
a separate unpack module for use by other structures, such as
SMBIOS.
- Add a helper for unpacking a series of substructures
Numerous tables follow the pattern of unpacking one of several
possible substructure classes repeatedly until running out of data
in the unpackable. Capture that pattern in a helper function
unpack_all.
- Add parsing for the FACP
- Handle SRAT subtables with "enabled" other than APIC and X2APIC
affinity
- Handle systems without an APIC
- Fix wrapping of text before paging to avoid hitting 80th column
GRUB automatically wraps text at the 80th column, and that automatic
wrapping breaks the pager's count of lines. However, acpi wrapped
lines at 78 characters and used a two-space indent; thus, lines
exactly 78 characters long, or with word lengths that resulted in a
78-character line, would end up printing an 80th character and
triggering GRUB's word-wrapping. Fix by changing wrapping to 77
characters.
- Many improvements to SMBIOS parsing and decoding; in particular:
- Rewrite smbios to use unpack, and decode structures more thoroughly;
includes contributions from Scott Lawson.
- In type 0 (BIOS information), handle the minor version correctly
The minor version in this structure represents the digits of a
decimal value, so 34 means .34, 4 means .4, and 41 means .41, so
comparing the numeric value of the minor version (for instance, >=
4) does not work correctly. Compare it as a string instead.
- When dumping SMBIOS structures, dump the string table and its memory
This helps when trying to hand-decode an unknown SMBIOS structure.
- Decode several more SMBIOS structures, and handle parse failures
more gracefully
Previously, decode failures in any SMBIOS structure would result in
a complete parse failure and no data. Catch exceptions inside each
structure parser, and preserve the fields decoded so far.
- Move line-wrapping into ttypager, and use the pager for more menu options
SMBIOS, and miscellaneous ACPI bits, now use our pager rather than
GRUB's pager.
- smp: Mark mp_worker as noreturn
Triggers a warning with GCC 4.4.5 otherwise.
bits-862
========
The "A Complicated Parsing Interface (ACPI)" release
- Rewrite acpi module to use new unpacking, parsing, and classes
This introduces a new data unpacking infrastructure and class, replacing
most of the uses of namedtuple with something more extensible and
flexible. The new infrastructure handles nested tables and reused
common structures much more cleanly, and automatically generates output
code based on field-by-field formatting instructions.
In the process, add support for several new ACPI tables, including the RSDP,
RSDT, XSDT, _MAT, and FACS. Also decode more fields of existing tables, and
break out some flags fields into individual flags.
Update init and testacpi to handle the changes to the acpi API.
Most importantly, this new infrastructure makes it much easier to write tests
based on the contents of ACPI tables.
- acpi.get_table: Support retrieving the RSDP, RSDT, and XSDT
ACPICA's normal AcpiGetTable does not support retrieving these tables by
signature. Add C functions in _bits to retrieve them, and then hide the
special-casing in a new Python implementation of get_table, so that
acpi.get_table works transparently for these tables.
- Add new acpi.show_checksum function, to compute and display a table's
checksum
- Make acpi.get_table's instance parameter default to 1
The underlying AcpiGetTable method accepts either 0 or 1 to refer to the
first instance, 2 for the second instance, and so on. Using 0 seems
inconsistent; let's embrace the 1-based ordering.
- acpi: Preserve linebreaks when wrapping, to improve formatting of tables
- Avoid returning duplicate signatures in acpi.get_table_list()
acpi.get_table_list() returned one copy of a table signature for each
instance of a table. Return a sorted list of unique signatures instead.
- init: Make ACPI-related initialization more robust against exceptions
bits-849
========
- Add a top-level menu item to invoke the Python interactive interpreter
This avoids the need to hit 'c' for a GRUB command line only to type
"python".
- Prototype API for hierarchical CPU register decoding.
This allows syntax like:
platform.cpus[0].cpuids[0].max_leaf
platform.cpus[0].cpuids[1].aes
platform.cpus[0].msrs.IA32_APIC_BASE.x2apic_enable
Infrastructure implemented by Burt Triplett and Josh Triplett. CPUID
register decoding implemented by Cathy Ji.
- readline: Implement Ctrl-O, to run a line and load the next line from history
This makes it easy to re-run multi-line commands, with or without edits.
Note that since the Python interactive interpreter requires a blank line
after a multi-line block, the history will remember blank lines (though
not multiple consecutive blank lines).
- Add a new generated menu of all ACPI table decoding options
This new menu offers options to dump every table on the system
(including multiple instances), and decode any that BITS knows how to
decode.
Refactor the ACPI menus to split out table decoding, method decoding,
OS reporting, and the dump-everything option.
- Documentation updates:
- Create a new Documentation directory in the source for more detailed
documentation. Ship that directory as /boot/Documentation on BITS
images, as well.
- README: Mention Documentation directory.
- Add documentation on Python line-editing keybindings.
- Add a top-level menu item to browse documentation. Shows all files in
the new Documentation directory, with their filenames and the title from
their first line.
- Split microcode documentation into a new Documentation/microcode.txt
- Split reference-code documentation into a new
Documentation/reference-code.txt
- README: Move detailed dependency version info to README.Developers.txt.
Just leave a simple list of dependencies and links in the credits of
README.
bits-837
========
- Update to ACPICA version 20130517
- Update Python to 2.7.5
Update pyconfig.h, handle new definitions for 32-bit and 64-bit sized
integer types, and define EINTR (which Python will never receive but
nonetheless expects a definition of).
- Python readline: write out full lines at a time rather than
character-by-character
- Add a new Python "bitfields" module for bitfield manipulation
Most Intel documentation references bitfields defined as [msb:lsb], or
as [bit]; this module allows creating and extracting such fields without
having to translate them to shifts and masks.
- Add processor socket/core/thread topology decode and display. Contributed
by Cathy Ji.
- Provide a more user-friendly exception when asking for a CPUID on a
non-existent CPU
Now raises a RuntimeError with a clear error message, rather than a
TypeError complaining about the inability to *-splat out a None.
- bits.cpus(): Cache the list of CPUs
bits.cpus() recomputed the list of CPUs every time, even though it never
changed. Cache it instead. Particularly relevant for
bits.bsp_apicid(), which calls bits.cpus() to produce the entire list
only to return the zeroth element.
bits-829
========
The "lines and pages" release.
- Fix readline for the case of multiple terminals with different sizes
In particular, this fixes readline when simultaneously outputting to an
80x24 serial terminal and an 80x25 VGA terminal.