OSDev.org

The Place to Start for Operating System Developers
It is currently Thu May 30, 2024 2:04 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Finding the kenrel (ext*)
PostPosted: Sun May 19, 2024 11:17 am 
Offline
Member
Member
User avatar

Joined: Mon Sep 21, 2020 9:51 am
Posts: 102
Location: Aboard the Enterprise
Hi all.

i'm sure this is a very basic question, but I've been working on my bootloader, and I wondered if there's a way to locate which inode belongs to the kernel binary (in the ext family), other than just going through all the inodes and checking if they're the kernel. I've done some searching, and the closest I can find is a reserved inode for the bootloader, but that's not what I'm after.

Thanks!

_________________
USS Enterprise NCC-1701,
The Final Frontier,
Space,
The Universe

Live Long And Prosper

Slava Ukraini!
Слава Україні!


Top
 Profile  
 
 Post subject: Re: Finding the kenrel (ext*)
PostPosted: Sun May 19, 2024 11:57 am 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 1619
If you have a path name, you can just look it up. I-Node 2 is the root directory, so open it, then iterate through the directory, find the first path name, open its i-node, find the second one, etc. until you have iterated through the entire path. That's actually how most people find a file in a file system.

_________________
Carpe diem!


Top
 Profile  
 
 Post subject: Re: Finding the kenrel (ext*)
PostPosted: Sun May 19, 2024 12:36 pm 
Offline
Member
Member
User avatar

Joined: Mon Sep 21, 2020 9:51 am
Posts: 102
Location: Aboard the Enterprise
nullplan wrote:
If you have a path name, you can just look it up. I-Node 2 is the root directory, so open it, then iterate through the directory, find the first path name, open its i-node, find the second one, etc. until you have iterated through the entire path. That's actually how most people find a file in a file system.

That's what I figured. I was afraid I might have been missing some sort of lookup table by filename or something. Thanks.

_________________
USS Enterprise NCC-1701,
The Final Frontier,
Space,
The Universe

Live Long And Prosper

Slava Ukraini!
Слава Україні!


Top
 Profile  
 
 Post subject: Re: Finding the kenrel (ext*)
PostPosted: Sun May 19, 2024 2:27 pm 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 1619
Apparently, there is some sort of look-up table on large directories, but it is only optional, only on large directories, and only tells you which filesystem block contains the directory entry you are looking for. Way overkill for a bootloader. So I'd just stick to reading the directories normally.

_________________
Carpe diem!


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: No registered users and 10 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