Skip to content

Task02: Implement hardware detector script#158

Open
SlavaGolubnichiy wants to merge 3 commits intoKernel-GL-HRK:mainfrom
SlavaGolubnichiy:ViacheslavHolubnychyi
Open

Task02: Implement hardware detector script#158
SlavaGolubnichiy wants to merge 3 commits intoKernel-GL-HRK:mainfrom
SlavaGolubnichiy:ViacheslavHolubnychyi

Conversation

@SlavaGolubnichiy
Copy link

Hardware detector script implemented.

The script detects the following plugged hardware:

  • mounted devices using /dev/sd
    . location and type parameters
  • USB-devices
    . id, name
  • block devices
    . name, size, type, mountpoint
  • SCSI
    . name, hctl, type, vendor, model, rev, tran
  • bus devices
    . bus, device, class description
  • PCI
    . id, type, name, rev
  • I2C
    . bus, number of busses, their i2c devices

Added file RockPaperScissors.c with implemented functions:
	- randomize() which returns 32-bit pseudo-random number;
	- get_rps_id() which returns rps-object's id by it's symbol;
	- get_rps_symbol() which returns rps-object's symbol by it's id;
	- get_rps_string() which return rps-object's name by it's id;
	- rps_does_first_win() which implements rps-games rules;
	- main() which is program entry-point, contains program logic;

Signed-off-by: SlavaGolubnichiy <vyacheslav.golubnichiy@gmail.com>
Added file named Makefile, used to build an executable with gcc.
Scenarios, implemented in Makefile:
	- program (builds object-files and an executable);
	- RockPaperScissors.o (builds RockPaperScissors.o object file);
	- clean (removes object files and an executable);

Signed-off-by: SlavaGolubnichiy <vyacheslav.golubnichiy@gmail.com>
Script detects following plugged hardware:
- mounted devices using /dev/sd
	. location and type parameters
- USB-devices
	. id, name
- block devices
	. name, size, type, mountpoint
- SCSI
	. name, hctl, type, vendor, model, rev, tran
- bus devices
	. bus, device, class description
- PCI
	. id, type, name, rev
- I2C
	. bus, number of busses, their i2c devices

Signed-off-by: SlavaGolubnichiy <vyacheslav.golubnichiy@gmail.com>
@alexposukhov
Copy link
Contributor

This pull request should base on commit db09a10
Target branch SHOULD NOT be main. You should merge your change to your branch.
You should create new branch for every new task.

@alexposukhov alexposukhov added Change requested change requested and removed Ready for review labels Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Change requested change requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants