Printing memory in c
-
- Posts: 9
- Joined: Tue Jul 17, 2012 11:09 am
Re: Printing memory in c
Or I'm doing os development because it's fun and I want a challenge to help me learn even faster.
-
- Member
- Posts: 255
- Joined: Tue Jun 15, 2010 9:27 am
- Location: Flyover State, United States
- Contact:
Re: Printing memory in c
If OS dev. is one of your first projects then you are going to run into some big trouble sooner or later as I did when I first started.letrstotheprez wrote:Or I'm doing os development because it's fun and I want a challenge to help me learn even faster.
If you just want to know how to write formatted output, then there is no reason to go through all the pain of writing even a basic kernel to do it, just write a function that uses putchar or puts to write the information once you've formatted. Then it can run in user-mode where it is much easier to debug.
Re: Printing memory in c
This post is not an actual answer to you question but I would like to introduce an approach that might help you with this. This also applies to the low-level programming in general.letrstotheprez wrote:I've been reading through the babysteps tutorials; does anyone have an example c function that works similarly to the example in babystep 8?
Try to learn to visualize how basic C code snippets usually get translated to the assembly (for example, gcc with -S switch is quite handy). After doing that for a while, you will have a good understanding what is the relation between C and the assembly. That helps really much.
They are different language, of course, but I think that they are not vastly different. They are both rather low-level.letrstotheprez wrote:I know both but assembly is still new enough to me that it's hard to translate it to c because they're so vastly different.
Dennis Ritchie wrote:[C has] the power of assembly language and the convenience of ... assembly language.
-
- Posts: 9
- Joined: Tue Jul 17, 2012 11:09 am
Re: Printing memory in c
I'm looking much farther into printf() now and deciding how I plan to implement it.
I know I'm going to run into challenges with this project but I'm hoping that I will because I enjoy them. This is the reason why I like programming; it gives me an opportunity to work through problems and forces me to learn a lot as I go.
I know I'm going to run into challenges with this project but I'm hoping that I will because I enjoy them. This is the reason why I like programming; it gives me an opportunity to work through problems and forces me to learn a lot as I go.
Re: Printing memory in c
Here you go: http://www.sparetimelabs.com/tinyprintf/index.html. It took about 30 seconds on Google to find that.
Google is a great resource; learn to use it wisely and you will have all the answers. And if it takes a little longer than 30 seconds you'll probably learn a great deal more than you intended. If you want to be at all successful in OS development you are going to learn how to do simple research - else, how are you going to do the hard stuff?
Google is a great resource; learn to use it wisely and you will have all the answers. And if it takes a little longer than 30 seconds you'll probably learn a great deal more than you intended. If you want to be at all successful in OS development you are going to learn how to do simple research - else, how are you going to do the hard stuff?