How do you implement bread() in your kernel?

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
Post Reply
irvanherz
Member
Member
Posts: 27
Joined: Mon Sep 19, 2016 5:34 am

How do you implement bread() in your kernel?

Post by irvanherz »

Hi, all...
I have read plenty books about VFS. Comparing designs from Linux and UNIX-likes.
Linux's bread() will end up in disk driver's request() handler. But a book said that in some UNIX-like kernels, it will calls bread() from vnode/inode (struct inode_operations) who represented for specific disk devices.

Actually, I like simpler second method. But in doubt, I want to clarify what I was said from the book.
Is it right that some UNIX-likes using bread() inode/vnode operation? If so, why there are strategy() operation inside it too?

Thanks before..
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: How do you implement bread() in your kernel?

Post by Solar »

Code: Select all

loaf * bread()
{
     return malloc( sizeof( loaf ) );
}
Sorry, couldn't resist.
Every good solution is obvious once you've found it.
User avatar
eryjus
Member
Member
Posts: 286
Joined: Fri Oct 21, 2011 9:47 pm
Libera.chat IRC: eryjus
Location: Tustin, CA USA

Re: How do you implement bread() in your kernel?

Post by eryjus »

Solar wrote:

Code: Select all

loaf * bread()
{
     return malloc( sizeof( loaf ) );
}
Sorry, couldn't resist.
I'm so glad I wasn't the only one.... :lol:
Adam

The name is fitting: Century Hobby OS -- At this rate, it's gonna take me that long!
Read about my mistakes and missteps with this iteration: Journal

"Sometimes things just don't make sense until you figure them out." -- Phil Stahlheber
User avatar
Schol-R-LEA
Member
Member
Posts: 1925
Joined: Fri Oct 27, 2006 9:42 am
Location: Athens, GA, USA

Re: How do you implement bread() in your kernel?

Post by Schol-R-LEA »

First, take 4 cups of whole wheat flour, a cup and a half of milk, and two eggs...
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
irvanherz
Member
Member
Posts: 27
Joined: Mon Sep 19, 2016 5:34 am

Re: How do you implement bread() in your kernel?

Post by irvanherz »

OK, how about block_read()?. It was not so delicious as bread() taste like..
stevewoods1986
Member
Member
Posts: 80
Joined: Wed Aug 09, 2017 7:37 am

Re: How do you implement bread() in your kernel?

Post by stevewoods1986 »

I can't help it either. You need wheat, a few other ingredients and yeast 8) search C manuals... that might help
Post Reply