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

Support 5.x kernels #39

Merged
merged 22 commits into from
Apr 17, 2020

Conversation

dwalkes
Copy link
Collaborator

@dwalkes dwalkes commented Dec 22, 2019

A rollup of changes from Advanced Embedded Software Development Fall 2019 semester, focusing on adding support for 5.x kernels, Ubuntu 18.04 native builds, 2018.05 Buildroot release, and warrior branch of Yocto project.

Summary of Changes

  • Added eclipse support for ease of source code browsing/searching, see comments in the README file.
  • Disabled sbull, snull, and short modules which are not compiling on 5.0 at this time.
  • Modified access_ok wrapper to support kernel versions above or below 5.0
  • Added module_load and module_unload scripts to misc-modules.
  • Fixed several 5.x kernel build issues across several kernel modules.
  • Added misc-progs/test/nonblock.sh script to help with testing of non blocking IO
  • Added scull-shared directory and symlinks to avoid duplicating logic for components shared across all scull implementations.
  • Used mutex insetad of semaphore for semaphores used as mutexes.

dwalkes and others added 22 commits August 18, 2019 11:22
See [this update](https://lkml.org/lkml/2019/1/4/418) which removed the
type argument.
Generic versions of scull_load and scull_unload
Based on original intent in LDD3 to use init_MUTEX() and the fact that
this has been deprecated in favor of the [mutex
type](https://elixir.bootlin.com/linux/latest/source/Documentation/locking/mutex-design.txt)
 rework the scull and scullc examples to show the latest mutex design
suggestions.
* First pass attempt to fix aio_read and aio_write functions with
read_iter and write_iter functions.  Implementation compiles but is not
yet tested.  See relevant articles:
  	https://www.fclose.com/linux-kernels/572661/aio_read-and-aio_write-removed-linux-4-1/
	https://lwn.net/Articles/636466/
	https://www.kernel.org/doc/Documentation/filesystems/porting
`	https://lwn.net/Articles/535034/
and patch reference at
	https://lwn.net/Articles/535178/
* Added a scull-shared folder which can be used with symlinks to avoid
the need to copy code in multiple scull files.  This was useful for the
aio refactor since this code was shared across several scull
implementations.
* Deployed semaphore to mutex transition to remaining files which had
not yet been refactored.
* Fixed one time reference to work with new API
* Fixed makefile to remove SUBDIRS reference and associated make
warning.
More semaphore references converted to mutex
To test non blocking I/O on a device
The current implementation uses the same name for every device, which
results in a kernel panic on attempts to unload.
* Removed init_name on bus device since [this
comment](https://elixir.bootlin.com/linux/v5.3.5/source/drivers/base/core.c#L2085)
suggests static name devices should be converted.
* Fix dev_set_name to use device name instead of hard-coded ldd0 for
devices.
* Add load of lddbus dependent module when starting sculld
Compile is now working for this module.
This was referenced Dec 22, 2019
@dwalkes
Copy link
Collaborator Author

dwalkes commented Dec 22, 2019

@martinezjavier I have included a rollup of changes I've made to support the course I taught last semester. I'm going to plan to keep this updated to support latest Ubuntu builds as well as builds on Buildroot and Yocto versions we use for the course. Let me know if you'd like any changes to these, or if you'd prefer I start a new repo instead. I think there are several open pull requests which are resolved by this one, I've put comments in those as well.

@dwalkes
Copy link
Collaborator Author

dwalkes commented Feb 7, 2020

@martinezjavier and @mbgg are you planning to keep this repository up to date going forward and, if so, would you like to include these commits or should I create a parallel project to track the commits for my class?

@martinezjavier martinezjavier merged commit 2ebe11e into martinezjavier:master Apr 17, 2020
@martinezjavier
Copy link
Owner

@dwalkes sorry for not answering before and thanks a lot for the patches!

I started this repo a decade ago when I was also teaching and haven't really had time to take care of it for years.

Some time ago @mbgg mentioned that he was interested in keeping the repo up-do-date but he has also been busy.

If you want I can include you as a collaborator as well or feel free to fork the project. For some reasons this repository seems to be referenced in different places so probably would make sense to do the former if you prefer that option.

@dwalkes
Copy link
Collaborator Author

dwalkes commented Apr 18, 2020

@martinezjavier thanks for the response!

If you want I can include you as a collaborator as well

That would be great, thanks. I'll still propose all my changes as pull requests from my class repository if you want to weigh in but I'll plan on updating at least once per year as long as I'm teaching my class.

I think it makes more sense to keep this repository going rather than starting a new one as yours has been forked/starred most often and it was still the most up to date of the Linux Device Driver book source code I found when I started my class last year.

@martinezjavier
Copy link
Owner

I think it makes more sense to keep this repository going rather than starting a new one

@dwalkes Ok, great. I've invited you as a collaborator now, thanks!

@jypan-ccu
Copy link
Contributor

jypan-ccu commented Aug 13, 2020

Thank you all guys for kernel 5.x update. I am a newbie of github and try to fix all of snull/sbull/short with timespec64 and jiq/jit/seq with timers. Wish you can try them and I am also going to teach my class next semester with these codes. I have not fully tried all, but I modified them based on a previous version from @martinezjavier and a current version from @dwalkes (cu-ecen-5013)
https://github.com/jypan-ccu/ldd3-k5.git

@dwalkes
Copy link
Collaborator Author

dwalkes commented Aug 13, 2020

@jypan-ccu thanks for your comments and for helping with updates.

I have some cleanup I hope to do this weekend in preparation for the semester as well.

As for your changes if you could fork this repo and then create a pull request from your fork this will be the easiest way for us to incorporate them.

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.

4 participants