Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 926041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:37:08+00:00 2026-05-15T19:37:08+00:00

I just wrote a RTC driver for an NXP RTC chip on my board,

  • 0

I just wrote a RTC driver for an NXP RTC chip on my board, it works great. This chip also has some battery backed RAM that I’d like to make available to a user space application. The RTC framework doesn’t support this. It’s only 512 bytes but I’m tossed between doing a seekable CHAR driver or a full blown BLOCK driver. I’ve never done a block driver before but it appears to require a bit more information than a simple CHAR.

I could also interface with IOCTLS but that doesn’t feel as clean as it could be. What feels like the best way to make these bytes available to userland?

[EDIT] I forgot to mention that that the RTC chip is hanging off an I2C port, it’s not mapped into memory, thus not making it a good candidate for mmaping. [/EDIT]

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T19:37:09+00:00Added an answer on May 15, 2026 at 7:37 pm

    Block drivers are only for devices that look like disk drives. Are you going to put a filesystem on your 512 bytes? No? Make it a character device.

    You could just do it like other drivers have. Check out drivers/char/nvram.c. That creates a char device you can open(), read(), write(), lseek(), and close().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just wrote a new web part and now I am getting this error
I just wrote some code to scale a font to fit within (the length
I just wrote a whole blurb on how I reached this point, but figured
I just wrote some new utility methods within a non-page class for an existing
I just wrote this function to read a series of email addresses from a
Guys, I am very new to c++. I have just wrote this class: class
I just wrote some code, looked it over, and wanted to cry. Lines that
I just wrote up this test to see if I was crazy... using System;
I just wrote this... horrible line of Ruby code, and I'm wondering if there
I just wrote this code: private double PerformOperation(OperationEnum operation, double aggregateValue, double sourceValue) {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.