LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 03-24-2020, 10:50 AM   #31
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,090

Rep: Reputation: 2483Reputation: 2483Reputation: 2483Reputation: 2483Reputation: 2483Reputation: 2483Reputation: 2483Reputation: 2483Reputation: 2483Reputation: 2483Reputation: 2483

He hasn't done much for you yet, I gather. Buggy asm code is very easily done and a bitch to find.

I did some Assembler back in the day; it's the sort of stuff that gives you a headache before you start work on it. I was doing machine code for microcontrollers, so I was the complete OS, and the only I/O was toggling CPU legs. There was some great stuff done for CP/M in Assembler.

I'm doing a web search for my issue, and I'll restore the whole disk if I have to. I hope he sorts you out.
 
Old 03-24-2020, 11:49 AM   #32
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 8,041

Original Poster
Blog Entries: 19

Rep: Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653
He says he's fixed it. That was quick work! I need to test out the new version but I don't know exactly how to check it out. I don't understand git at all.

I've asked him for detailed instructions.

He has fixed it! I don't know what he did but he told me how to check out the new version and it works. I just tested it out for him. I'm gobsmacked! I didn't know this kind of thing could get done so quickly.

Last edited by hazel; 03-24-2020 at 12:47 PM. Reason: Added update paragraph
 
Old 03-24-2020, 01:48 PM   #33
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 8,041

Original Poster
Blog Entries: 19

Rep: Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653
Well, I think I partly understand this now. There's an assembler instruction called cpuid that overwrites something. This was allowed for in the code; the register it overwrites is saved elsewhere and then written back.
Code:
  "push %%rbx\n\t"
  "cpuid\n\t"
  "mov %%ebx,(%%rsi)\n\t"
  "mov %%ecx,4(%%rsi)\n\t"
  "mov %%edx,8(%%rsi)\n\t"
  "pop %%rbx"
But the restore doesn't work correctly for reasons that are obscure to me.
Quote:
As modern optimizing compilers don't bother anymore with adjusting the stack pointer when they allocate local variables - they just 'know' that there is free space - the rbx register gets saved/restored from the same memory the signature[] array is using. So that part never worked.
The bug is apparently an old one but it popped up in my machine because my compiler decided to put hd_data into that register.
 
Old 03-24-2020, 02:38 PM   #34
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,090

Rep: Reputation: 2483Reputation: 2483Reputation: 2483Reputation: 2483Reputation: 2483Reputation: 2483Reputation: 2483Reputation: 2483Reputation: 2483Reputation: 2483Reputation: 2483
Code:
git clone <url>
usually does it from a console or you can surf there and there's a 'clone' button. Surf to github.com, search for your project in the search bar. Very intuitive. Even I can manage it. Occasionally you have to cobble up the makefiles - 'xmkmf -a' or some such. I only find it a pain if they use cmake, which an increasing number are doing.


EDIT: On the Assembler, this is cheeky, but would this do it
Code:
 "push %%rbx\n\t"
  "push %%rbx\n\t"
  "cpuid\n\t"
  "mov %%ebx,(%%rsi)\n\t"
  "mov %%ecx,4(%%rsi)\n\t"
  "mov %%edx,8(%%rsi)\n\t"
  "pop %%rbx"
  "pop %%rbx"
The idea is to use 2 stack spots, only one of which gets overwritten

Last edited by business_kid; 03-24-2020 at 02:50 PM.
 
Old 03-24-2020, 03:05 PM   #35
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 8,041

Original Poster
Blog Entries: 19

Rep: Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653
No need for that. It's been fixed now. He sent me the git instructions and I was able to update and test the new branch out. It works. I've sent him the output in case he's interested.

What I find amazing is that a minor bug (it doesn't seem to have affected anyone else) has been cleared so fast all because I complained. Talk about communal effort!
 
Old 03-25-2020, 08:51 AM   #36
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,090

Rep: Reputation: 2483Reputation: 2483Reputation: 2483Reputation: 2483Reputation: 2483Reputation: 2483Reputation: 2483Reputation: 2483Reputation: 2483Reputation: 2483Reputation: 2483
Well, it's good it's fixed. I doubt if M$. or Apple would bother unless their programmer got the bug. Mind you linux users have the logs, the detailed errors, and a lot of dev tools available.

My usb dev mentioned he had been getting complaints about the bug in post #14, had tried all he could, and wouldn't put more time on it until he had some information to work with. We got him that. Building the kernels was the large headache, and time consuming.

But would you as a programmer rest easy if you knew a bug in your code was upsetting folks? I don't think so.
 
Old 03-25-2020, 10:47 AM   #37
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 8,041

Original Poster
Blog Entries: 19

Rep: Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653
The only programs I've written were for my own use. There are a couple of them available for download on my website but they're basically jeux d'esprit and they probably do have bugs in them. We're talking here about an "official" program that's part of the Linux ecosystem. It came from Suse originally.

You're certainly right about Microsoft. You report a bug to them and it just goes into a queue. If you're lucky, it gets dealt with months later in the next service pack.
 
Old 03-25-2020, 11:25 AM   #38
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,321

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Hazel,

Just wondering if you could post the URL for getting the updated and fixed hwinfo source.

I removed and reinstalled hwinfo from SBo, that still fails. I guess the maintainer for hwinfo needs to be informed of the now fixed source.

Thank-you for your work on this problem. It was well over my head.
 
Old 03-25-2020, 11:32 AM   #39
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 8,041

Original Poster
Blog Entries: 19

Rep: Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653Reputation: 4653
You can get it via git from https://github.com/openSUSE/hwinfo. git clone and then git checkout sw_07. You'll have to build it with "make static", otherwise the build crashes.

Presumably there will soon be a new release with the fix in it.
 
1 members found this post helpful.
Old 03-25-2020, 11:35 AM   #40
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,321

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Thank-you!
 
Old 01-06-2021, 07:21 PM   #41
vesperto
LQ Newbie
 
Registered: Jun 2006
Location: Portugal
Distribution: gentoo and slackware and other(s)
Posts: 28

Rep: Reputation: Disabled
Quote:
Originally Posted by hazel View Post
What I find amazing is that a minor bug (it doesn't seem to have affected anyone else) has been cleared so fast all because I complained. Talk about communal effort!
I've been affected. Well, my old laptop to be precise.
I've poked the SBo maintainer.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Slackware64 14.2 + Multilib + hwinfo = Kernel Oops kjhambrick Slackware 1 08-15-2016 06:40 AM
Hwinfo RPM for RHEL 5 or Centos 5 /6 rch Linux - Software 3 07-22-2011 09:33 AM
Accessing a hardware device based on hwinfo output (Yet another ps/2 mouse issue) kessaris Linux - Hardware 2 06-26-2008 07:56 PM
hwinfo??? wongmoxy Mandriva 7 04-20-2007 03:03 AM
Hardware Inventory - hwinfo - All Distros codegomer Linux - General 4 03-02-2004 07:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 10:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration