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 6062755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:05:17+00:00 2026-05-23T09:05:17+00:00

I’m following the kernel development tutorial at osdever , and I’m at the printing

  • 0

I’m following the kernel development tutorial at osdever, and I’m at the printing to the screen portion of the tutorial. It compiles just fine, no errors or warnings, but when it goes to link, I get:

screen.o: In function `scroll':
screen.c:(.text+0x12c): undefined reference to `memcpy'
screen.o: In function `put_str':
screen.c:(.text+0x249): undefined reference to `strlen'

I do have a include statement to system.h at the top of screen.c, and in system.h I have

#ifndef __SYSTEM_H
#define __SYSTEM_H

extern unsigned char *memcpy(unsigned char *dest, const unsigned char *src, int count);
extern unsigned char *memset(unsigned char *dest, unsigned char val, int count);
extern unsigned short *memsetw(unsigned short *dest, unsigned short val, int count);
extern int strlen(const char *str);
extern unsigned char inportb (unsigned short _port);
extern void outportb (unsigned short _port, unsigned char _data);
extern void clear();
extern void put_char(unsigned char c);
extern void put_str(unsigned char *str);
extern void set_color(unsigned char fcol, unsigned char bcol);
extern void init_video();

#endif

I can’t find anything about this on the web, and there’s no help in the tutorial. It seems that when I change the order in the linker statement, from

/usr/local/cross/bin/i586-elf-ld -T link.ld -o kernel.bin start.o main.o screen.o

to

/usr/local/cross/bin/i586-elf-ld -T link.ld -o kernel.bin start.o screen.o main.o

I get

screen.o: In function `put_str':
screen.c:(.text+0x249): undefined reference to `strlen'
main.o: In function `main':
main.c:(.text+0x9b): undefined reference to `init_video'

Edit
http://pastebin.com/ibBAVpe5 – Main.c

  • 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-23T09:05:18+00:00Added an answer on May 23, 2026 at 9:05 am

    You haven’t provided a strlen, so where exactly should it come from? In a normal compile, the ld command line will have an -lc added to it by cc to bring in the standard library. Given the indications that this is intended to be standalone, you will need to provide your own support routines such as strlen and memcpy; you can’t use a standard C library (or would have to be very careful about it) because that will try to call into the kernel for some things.

    #

    That doesn’t explain the other problem with reordering objects, nor the discussion in the comments below. This leads me to believe you have a broken or possibly incompatible linker script (the -T link.ld). Paste that?

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

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have a French site that I want to parse, but am running into
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
I want to construct a data frame in an Rcpp function, but when I
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti

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.