seL4 / seL4_libs

No-assurance libraries for rapid-prototyping of seL4 apps.
https://docs.sel4.systems
Other
52 stars 62 forks source link

make debug_print_bootinfo() a bit more verbose #51

Open axel-h opened 2 years ago

axel-h commented 2 years ago

On i.MX6/sabre is prints this now:

Node 0 of 1
IO-MMU PT levels:       0
initial thread domain:  0
root cnode size:        2^13 (8192)
IPC buffer:             0x14a000
shared pages:           none [0 --> 0]
user image paging:      [14 --> 16]
extra boot info pages:  [16 --> 27] (extraLen: 41721)
user image pages:       [27 --> 341]
untyped memory:         [341 --> 415] (74/230 descriptors used)
empty slots:            [415 --> 8192] (7777)
extra boot info blobs:
    type: 6, offset 0, len: 41721
physical memory map with available untypeds:
           0: 2^23, device memory, slot 341
    0x800000: 2^21, device memory, slot 342
    0xa00000: reserved
    0xa03000: 2^12, device memory, slot 343
    0xa04000: 2^14, device memory, slot 344
    0xa08000: 2^15, device memory, slot 345
    0xa10000: 2^16, device memory, slot 346
    0xa20000: 2^17, device memory, slot 347
    0xa40000: 2^18, device memory, slot 348
    0xa80000: 2^19, device memory, slot 349
    0xb00000: 2^20, device memory, slot 350
    0xc00000: 2^22, device memory, slot 351
   0x1000000: 2^24, device memory, slot 352
   0x2000000: 2^25, device memory, slot 353
   0x4000000: 2^26, device memory, slot 354
   0x8000000: 2^27, device memory, slot 355
  0x10000000: 2^16, free memory, slot 387
  0x10010000: reserved
  0x10181000: 2^12, free memory, slot 388
  0x10182000: 2^13, free memory, slot 389
  0x10184000: 2^14, free memory, slot 390
  0x10188000: 2^15, free memory, slot 391
  0x10190000: 2^16, free memory, slot 392
  0x101a0000: 2^17, free memory, slot 393
  0x101c0000: 2^18, free memory, slot 394
  0x10200000: 2^21, free memory, slot 395
  0x10400000: 2^22, free memory, slot 396
  0x10800000: 2^23, free memory, slot 397
  0x11000000: 2^24, free memory, slot 398
  0x12000000: 2^25, free memory, slot 399
  0x14000000: 2^26, free memory, slot 400
  0x18000000: 2^27, free memory, slot 401
  0x20000000: 2^27, free memory, slot 402
  0x28000000: 2^26, free memory, slot 403
  0x2c000000: 2^25, free memory, slot 404
  0x2e000000: 2^24, free memory, slot 405
  0x2f000000: reserved
  0x2f100000: 2^20, free memory, slot 406
  0x2f200000: 2^21, free memory, slot 407
  0x2f400000: 2^22, free memory, slot 408
  0x2f800000: 2^22, free memory, slot 409
  0x2fc00000: 2^21, free memory, slot 410
  0x2fe00000: 2^19, free memory, slot 411
  0x2fe80000: 2^18, free memory, slot 412
  0x2fec0000: reserved
  0x2fef7c00: 2^10, free memory, slot 413
  0x2fef8000: 2^15, free memory, slot 414
  0x2ff00000: 2^20, device memory, slot 356
  0x30000000: 2^29, device memory, slot 357
  0x50000000: 2^29, device memory, slot 358
  0x70000000: 2^29, device memory, slot 359
  0x90000000: 2^29, device memory, slot 360
  0xb0000000: 2^29, device memory, slot 361
  0xd0000000: 2^29, device memory, slot 362
  0xf0000000: 2^27, device memory, slot 363
  0xf8000000: 2^26, device memory, slot 364
  0xfc000000: 2^25, device memory, slot 365
  0xfe000000: 2^24, device memory, slot 366
  0xff000000: 2^23, device memory, slot 367
  0xff800000: 2^22, device memory, slot 368
  0xffc00000: 2^21, device memory, slot 369
  0xffe00000: 2^20, device memory, slot 370
  0xfff00000: 2^19, device memory, slot 371
  0xfff80000: 2^18, device memory, slot 372
  0xfffc0000: 2^17, device memory, slot 373
  0xfffe0000: 2^16, device memory, slot 374
  0xffff0000: 2^15, device memory, slot 375
  0xffff8000: 2^14, device memory, slot 376
  0xffffc000: 2^13, device memory, slot 377
  0xffffe000: 2^12, device memory, slot 378
  0xfffff000: 2^11, device memory, slot 379
  0xfffff800: 2^10, device memory, slot 380
  0xfffffc00: 2^9, device memory, slot 381
  0xfffffe00: 2^8, device memory, slot 382
  0xffffff00: 2^7, device memory, slot 383
  0xffffff80: 2^6, device memory, slot 384
  0xffffffc0: 2^5, device memory, slot 385
  0xffffffe0: 2^4, device memory, slot 386
  0xfffffff0: reserved
pingerino commented 2 years ago

What did the previous output look like?

axel-h commented 2 years ago
Node 0 of 1
  IOPT levels:     0
  IPC buffer:      0x3f6000
  Empty slots:     [1102 --> 8192)
  sharedFrames:    [0 --> 0)
  userImageFrames: [30 --> 1028)
  userImagePaging: [14 --> 19)
  untypeds:        [1028 --> 1102)
  Initial thread domain: 0
  Initial thread cnode size: 13
  List of untypeds
  ------------------
  Paddr    | Size   | Device
  0 | 23 | 1
  0x800000 | 21 | 1
  0xa03000 | 12 | 1
  0xa04000 | 14 | 1
  0xa08000 | 15 | 1
  0xa10000 | 16 | 1
  0xa20000 | 17 | 1
  0xa40000 | 18 | 1
  0xa80000 | 19 | 1
  0xb00000 | 20 | 1
  0xc00000 | 22 | 1
  0x1000000 | 24 | 1
  0x2000000 | 25 | 1
  0x4000000 | 26 | 1
  0x8000000 | 27 | 1
  0x2ff00000 | 20 | 1
  0x30000000 | 29 | 1
  0x50000000 | 29 | 1
  0x70000000 | 29 | 1
  0x90000000 | 29 | 1
  0xb0000000 | 29 | 1
  0xd0000000 | 29 | 1
  0xf0000000 | 27 | 1
  0xf8000000 | 26 | 1
  0xfc000000 | 25 | 1
  0xfe000000 | 24 | 1
  0xff000000 | 23 | 1
  0xff800000 | 22 | 1
  0xffc00000 | 21 | 1
  0xffe00000 | 20 | 1
  0xfff00000 | 19 | 1
  0xfff80000 | 18 | 1
  0xfffc0000 | 17 | 1
  0xfffe0000 | 16 | 1
  0xffff0000 | 15 | 1
  0xffff8000 | 14 | 1
  0xffffc000 | 13 | 1
  0xffffe000 | 12 | 1
  0xfffff000 | 11 | 1
  0xfffff800 | 10 | 1
  0xfffffc00 | 9 | 1
  0xfffffe00 | 8 | 1
  0xffffff00 | 7 | 1
  0xffffff80 | 6 | 1
  0xffffffc0 | 5 | 1
  0xffffffe0 | 4 | 1
  0x10000000 | 16 | 0
  0x1042d000 | 12 | 0
  0x1042e000 | 13 | 0
  0x10430000 | 16 | 0
  0x10440000 | 18 | 0
  0x10480000 | 19 | 0
  0x10500000 | 20 | 0
  0x10600000 | 21 | 0
  0x10800000 | 23 | 0
  0x11000000 | 24 | 0
  0x12000000 | 25 | 0
  0x14000000 | 26 | 0
  0x18000000 | 27 | 0
  0x20000000 | 27 | 0
  0x28000000 | 26 | 0
  0x2c000000 | 25 | 0
  0x2e000000 | 24 | 0
  0x2f100000 | 20 | 0
  0x2f200000 | 21 | 0
  0x2f400000 | 22 | 0
  0x2f800000 | 22 | 0
  0x2fc00000 | 21 | 0
  0x2fe00000 | 19 | 0
  0x2fe80000 | 18 | 0
  0x2fef8800 | 11 | 0
  0x2fef9000 | 12 | 0
  0x2fefa000 | 13 | 0
  0x2fefc000 | 14 | 0
  Untyped summary
  1 untypeds of size 4
  1 untypeds of size 5
  1 untypeds of size 6
  1 untypeds of size 7
  1 untypeds of size 8
  1 untypeds of size 9
  1 untypeds of size 10
  2 untypeds of size 11
  4 untypeds of size 12
  3 untypeds of size 13
  3 untypeds of size 14
  2 untypeds of size 15
  4 untypeds of size 16
  2 untypeds of size 17
  4 untypeds of size 18
  4 untypeds of size 19
  5 untypeds of size 20
  5 untypeds of size 21
  4 untypeds of size 22
  3 untypeds of size 23
  4 untypeds of size 24
  4 untypeds of size 25
  4 untypeds of size 26
  4 untypeds of size 27
  6 untypeds of size 29
pingerino commented 2 years ago

ok. Thanks for the improvement. Two comments:

both of these mean you can easily paste the data into a spread sheet or input file without manually munging the data.

axel-h commented 2 years ago

It's now:

-------------+------+----------+-------
  Phys Addr  | Size | Type     | Slot
-------------+------+----------+-------
           0 | 2^23 | device   | 341
    0x800000 | 2^21 | device   | 342
    0xa00000 | -    | reserved | -
    0xa03000 | 2^12 | device   | 343
    0xa04000 | 2^14 | device   | 344
    0xa08000 | 2^15 | device   | 345
    0xa10000 | 2^16 | device   | 346
...
axel-h commented 2 years ago

@kent-mcleod: I can also make this a separate function also. It's just that for what I usually do the memory map in the physical order more is more useful than the cap slot order. And the "Untyped summary" has not much use at all, as is mixes caps for free memory and device memory.

kent-mcleod commented 2 years ago

@kent-mcleod: I can also make this a separate function also. It's just that for what I usually do the memory map in the physical order more is more useful than the cap slot order. And the "Untyped summary" has not much use at all, as is mixes caps for free memory and device memory.

So maybe you just want to add a new function that prints a human readable physical memory map and uses the bootinfo_t struct as it's input?