A few years ago, there's an open source OS project which was pretty active:
https://github.com/minoca/os
The toolchains to build it were provided (https://www.minocacorp.com/download/#toolchain), unfortunately the website is down and no way to reach the maintainers.