Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for displaying the ISA string on RISC-V CPUs #24

Merged
merged 1 commit into from
Jan 12, 2023
Merged

Add support for displaying the ISA string on RISC-V CPUs #24

merged 1 commit into from
Jan 12, 2023

Conversation

aaronfranke
Copy link

This PR adds support for displaying the ISA string (like "rv64gc") in the CPU section on RISC-V CPUs.

I have tested this both on real hardware (Debian on StarFive VisionFive 2) and an emulator (Ubuntu on Qemu).

Example output on real hardware (Debian on StarFive VisionFive 2):

$ ./neofetch 
       _,met$$$$$gg.             user@starfive 
    ,g$$$$$$$$$$$$$$$P.          ------------- 
  ,g$$P"        """Y$$.".        OS: Debian GNU/Linux bookworm/sid riscv64 
 ,$$P'              `$$$.        Host: StarFive VisionFive V2 
',$$P       ,ggs.     `$$b:      Kernel: 5.15.0-starfive 
`d$$'     ,$P"'   .    $$$       Uptime: 2 mins 
 $$P      d$'     ,    $$P       Packages: 1888 (dpkg) 
 $$:      $$.   -    ,d$$'       Shell: bash 5.1.16 
 $$;      Y$b._   _,d$P'         Resolution: 3840x2160 
 Y$$.    `.`"Y$$$$P"'            Terminal: /dev/pts/0 
 `$$b      "-.__                 CPU: sifive,u74-mc rv64gc (4) @ 1.500GHz 
  `Y$$                           Memory: 399 MiB / 7927 MiB 
   `Y$$.                         Network: 100 Mbps 
     `$$b.
       `Y$$b.                                            
          `"Y$b._                                        
              `"""

Example output on the emulator (Ubuntu 20.04 on Qemu):

$ ./neofetch 
                             ....             ubuntu@ubuntu 
              .',:clooo:  .:looooo:.          ------------- 
           .;looooooooc  .oooooooooo'         OS: Ubuntu 20.04.2 LTS riscv64 
        .;looooool:,''.  :ooooooooooc         Host: riscv-virtio,qemu 
       ;looool;.         'oooooooooo,         Kernel: 5.8.0-14-generic 
      ;clool'             .cooooooc.  ,,      Uptime: 3 hours, 45 mins 
         ...                ......  .:oo,     Packages: 760 (dpkg) 
  .;clol:,.                        .loooo'    Shell: bash 5.0.17 
 :ooooooooo,                        'ooool    Terminal: /dev/pts/0 
'ooooooooooo.                        loooo.   CPU: rv64gch (8) 
'ooooooooool                         coooo.   Memory: 341 MiB / 16000 MiB 
 ,loooooooc.                        .loooo.   Network: Unknown 
   .,;;;'.                          ;ooooc
       ...                         ,ooool.                            
    .cooooc.              ..',,'.  .cooo.                             
      ;ooooo:.           ;oooooooc.  :l.
       .coooooc,..      coooooooooo.
         .:ooooooolc:. .ooooooooooo'
           .':loooooo;  ,oooooooooc
               ..';::c'  .;loooo:'
                             .

For comparison, here is what the output looks like in unifetch before this PR:

Old/existing output on real hardware (Debian on StarFive VisionFive 2):
$ ./neofetch 
       _,met$$$$$gg.             user@starfive 
    ,g$$$$$$$$$$$$$$$P.          ------------- 
  ,g$$P"        """Y$$.".        OS: Debian GNU/Linux bookworm/sid riscv64 
 ,$$P'              `$$$.        Host: StarFive VisionFive V2 
',$$P       ,ggs.     `$$b:      Kernel: 5.15.0-starfive 
`d$$'     ,$P"'   .    $$$       Uptime: 2 mins 
 $$P      d$'     ,    $$P       Packages: 1888 (dpkg) 
 $$:      $$.   -    ,d$$'       Shell: bash 5.1.16 
 $$;      Y$b._   _,d$P'         Resolution: 3840x2160 
 Y$$.    `.`"Y$$$$P"'            Terminal: /dev/pts/0 
 `$$b      "-.__                 CPU: sifive,u74-mc (4) @ 1.500GHz 
  `Y$$                           Memory: 399 MiB / 7927 MiB 
   `Y$$.                         Network: 100 Mbps 
     `$$b.
       `Y$$b.                                            
          `"Y$b._                                        
              `"""

Old/existing output on the emulator (Ubuntu 20.04 on Qemu):

$ ./neofetch 
                             ....             ubuntu@ubuntu 
              .',:clooo:  .:looooo:.          ------------- 
           .;looooooooc  .oooooooooo'         OS: Ubuntu 20.04.2 LTS riscv64 
        .;looooool:,''.  :ooooooooooc         Host: riscv-virtio,qemu 
       ;looool;.         'oooooooooo,         Kernel: 5.8.0-14-generic 
      ;clool'             .cooooooc.  ,,      Uptime: 3 hours, 47 mins 
         ...                ......  .:oo,     Packages: 760 (dpkg) 
  .;clol:,.                        .loooo'    Shell: bash 5.0.17 
 :ooooooooo,                        'ooool    Terminal: /dev/pts/0 
'ooooooooooo.                        loooo.   CPU: (8) 
'ooooooooool                         coooo.   Memory: 341 MiB / 16000 MiB 
 ,loooooooc.                        .loooo.   Network: Unknown 
   .,;;;'.                          ;ooooc
       ...                         ,ooool.                            
    .cooooc.              ..',,'.  .cooo.                             
      ;ooooo:.           ;oooooooc.  :l.
       .coooooc,..      coooooooooo.
         .:ooooooolc:. .ooooooooooo'
           .':loooooo;  ,oooooooooc
               ..';::c'  .;loooo:'
                             .

@hayatehay hayatehay merged commit 68d0bbb into nmimusic:staging Jan 12, 2023
@hayatehay
Copy link
Collaborator

Thank you!

@aaronfranke aaronfranke deleted the unifetch-riscv-isa branch January 12, 2023 16:04
This was referenced Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants