OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Mar 29, 2024 5:30 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Can I embed freetypes 2 in the kernel?
PostPosted: Sat May 02, 2020 1:26 pm 
Offline
Member
Member
User avatar

Joined: Sun Jul 21, 2019 7:34 am
Posts: 296
Hi.
I asked myself this question: is it possible to add freetypes 2 to the core? What dependencies are there? Has anyone done this?
Thanks.


Top
 Profile  
 
 Post subject: Re: Can I embed freetypes 2 in the kernel?
PostPosted: Sat May 02, 2020 6:20 pm 
Offline
Member
Member

Joined: Wed Mar 30, 2011 12:31 am
Posts: 676
There's no reason you couldn't embed freetype2 in your kernel... if you implemented all of the libc functions it depends on. Freetype can be built with no other dependencies than the standard library. But the real question isn't can you, but why would you want to? Why do you need TrueType text support in your kernel? Even the most ardent of monolithic kernel advocates would be hesitant to suggest having that kind of text rendering in the kernel. There's also security concerns if a user can control the fonts involved - TrueType hinting vulnerabilities were the cause of many a hack and jailbreak for everything from iOS (actually with freetype2, and several times) to the original Xbox (with Microsoft's own text rendering libraries).

_________________
toaruos on github | toaruos.org | gitlab | twitter | bim - a text editor


Top
 Profile  
 
 Post subject: Re: Can I embed freetypes 2 in the kernel?
PostPosted: Sat May 02, 2020 10:07 pm 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 1593
I'm a monolithic kernel guy, and I think putting freetype into your kernel is silly. Taking on that much complexity into the piece of software that is hardest to debug is bound to give you problems in the long run. I personally put my debug messages on serial console, because polling drivers for it are easy to write and very self-contained. For the screen, I shall provide access to the frame buffer with a device file, and access to input devices with event device files. This way, I get around having any virtual terminal support in my kernel, I will only provide pseudo-terminals (which are mostly about storing data), and the actual terminals can be emulated by user space. So the entire complexity of font rendering lands in userspace, where it belongs.

_________________
Carpe diem!


Top
 Profile  
 
 Post subject: Re: Can I embed freetypes 2 in the kernel?
PostPosted: Sun May 03, 2020 12:30 am 
Offline
Member
Member

Joined: Wed Mar 30, 2011 12:31 am
Posts: 676
nullplan wrote:
For the screen, I shall provide access to the frame buffer with a device file, and access to input devices with event device files. This way, I get around having any virtual terminal support in my kernel, I will only provide pseudo-terminals (which are mostly about storing data), and the actual terminals can be emulated by user space. So the entire complexity of font rendering lands in userspace, where it belongs.

Yep! I do the same. No terminal emulator in the kernel. The generic video driver has a little bitmap font renderer for visual crash messages, but all other text from the kernel is over serial (or can be redirected to a file, including a PTY, for debugging).

_________________
toaruos on github | toaruos.org | gitlab | twitter | bim - a text editor


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: 8infy, Majestic-12 [Bot] and 102 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group