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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
03-24-2020, 10:50 AM
|
#31
|
LQ Guru
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,090
|
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.
|
|
|
03-24-2020, 11:49 AM
|
#32
|
LQ Guru
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 8,041
Original Poster
|
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
|
|
|
03-24-2020, 01:48 PM
|
#33
|
LQ Guru
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 8,041
Original Poster
|
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.
|
|
|
03-24-2020, 02:38 PM
|
#34
|
LQ Guru
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,090
|
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.
|
|
|
03-24-2020, 03:05 PM
|
#35
|
LQ Guru
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 8,041
Original Poster
|
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!
|
|
|
03-25-2020, 08:51 AM
|
#36
|
LQ Guru
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,090
|
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.
|
|
|
03-25-2020, 10:47 AM
|
#37
|
LQ Guru
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 8,041
Original Poster
|
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.
|
|
|
03-25-2020, 11:25 AM
|
#38
|
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
|
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.
|
|
|
03-25-2020, 11:32 AM
|
#39
|
LQ Guru
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 8,041
Original Poster
|
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.
|
03-25-2020, 11:35 AM
|
#40
|
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
|
Thank-you!
|
|
|
01-06-2021, 07:21 PM
|
#41
|
LQ Newbie
Registered: Jun 2006
Location: Portugal
Distribution: gentoo and slackware and other(s)
Posts: 28
Rep:
|
Quote:
Originally Posted by hazel
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.
|
|
|
All times are GMT -5. The time now is 10:30 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|