OSDev.org

The Place to Start for Operating System Developers
It is currently Tue Apr 23, 2024 7:40 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 61 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject: Re: Where would I learn C and Assembly?
PostPosted: Tue May 02, 2017 8:28 am 
Offline
Member
Member

Joined: Mon May 01, 2017 3:56 am
Posts: 44
obiwac wrote:
john765 wrote:
obiwac wrote:
Not to let you down or be mean or anything, but developing an os without any experience with C is probably not a good idea. You should start with smaller projects, so that you can gain experience, and then once you feel comfortable, start the ambitious project of making and os.


Thank you for the advice. By the way, I've tried out AquaOS. It's great. However, there are a few bugs (like when you go into some programs, the OS freezes). Is the shell being worked on because it doesn't work?


Thanks! Indeed there are a lot of bugs and unimplemented features. :? . 0xB800 is hexadecimal. You should also probably get used to that. It's quite important.
http://www.wikihow.com/Understand-Hexadecimal The 0x in C just means that what you write after will be considered as hexadecimal.

Good luck! :)


I know that is hex. I'm fully aware. I know you add a h on the end of something in x86 assembly language. I actually think B8 is the mov instruction. It's a memory address, right?


Top
 Profile  
 
 Post subject: Re: Where would I learn C and Assembly?
PostPosted: Tue May 02, 2017 8:58 am 
Offline
Member
Member

Joined: Wed Oct 30, 2013 1:57 pm
Posts: 306
Location: Germany
john765 wrote:
I actually think B8 is the mov instruction. It's a memory address, right?
The phrasing of this is really confusing to me. Yes, the primary opcode B8 moves a imm16/32 into eax. However, this is completely unrelated. Going back, apparently you extracted this value from Bare Bones. It is the address of the VGA video buffer. If you would have read the page that was linked to you, you'd be aware of that. Also, you didn't read Bare Bones thoroughly. It explains why 0xB8000 is relevant and what writing there does. Long story short: yes, it's a memory address, and it's completely unrelated to instruction encoding.

john765 wrote:
I know you add a h on the end of something in x86 assembly language.
I'm really picky about this: it depends on the syntax. If you use AT&T syntax (GAS uses this), yes. If you use Intel syntax (nasm, yasm), hex values are written C-Style with the '0x' prefix.

john765 wrote:
StudlyCaps, the code in Bare Bones is insane. How did someone know how to do that? What do you have to read to make it run?
You can learn that by reading. You've been pointed to the wiki, so use it. It's the best place to start. After that, some of the most valueable information is obtainable by reading specs and Linux or FreeBSD drivers.

To pick up the title of this thread: you definitely shouldn't (and probably can't) learn C and Assembly on here or the wiki. There are resources dedicated to this, and osdev.org doesn't belong into that category for sure. Also, does this thread have anything to do with Operating System Development? My guess would be that this belongs into General Programming.

_________________
managarm


Top
 Profile  
 
 Post subject: Re: Where would I learn C and Assembly?
PostPosted: Tue May 02, 2017 9:23 am 
Offline
Member
Member

Joined: Mon Jul 05, 2010 4:15 pm
Posts: 595
Back in the day when I was a cub I wanted to learn C, however in absence of literature (computer science books was hard to obtain back then) I got to lend a book "Peter Norton's Assembly Language Book for the IBM PC". The book uses an MS-DOS command "debug" which every MS-DOS is shipped with, a simple version of gdb. With that program the book actually goes through the basics and an interactive way and you get a hands on what happens. Despite it is old and uses 16-bit real mode I think that the basics of assembly language is still valid today. After you have read that book you will understand assembler language. This book is good for people who don't understand hexadecimal, 2-complement values, op-codes, registers and so on. If you have already the basics, you will not find the book that informative.

Then you can learn C. I'm not sure what order is the best C first or assembler first.


Top
 Profile  
 
 Post subject: Re: Where would I learn C and Assembly?
PostPosted: Tue May 02, 2017 9:46 am 
Offline
Member
Member
User avatar

Joined: Fri Oct 27, 2006 9:42 am
Posts: 1925
Location: Athens, GA, USA
no92 wrote:
john765 wrote:
I know you add a h on the end of something in x86 assembly language.
I'm really picky about this: it depends on the syntax. If you use AT&T syntax (GAS uses this), yes. If you use Intel syntax (nasm, yasm), hex values are written C-Style with the '0x' prefix.


You have it backwards, I'm afraid, though that isn't hard to do. GAS, being a distant descendant the original Unix assembler, uses the C '0x' prefix, while Intel's own assembler, and the Microsoft Macro Assembler (MASM), use the postfix 'h'. Most of the other x86 assemblers, such as NASM or FASM, can use either, though the C format is usually preferred.

_________________
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.


Top
 Profile  
 
 Post subject: Re: Where would I learn C and Assembly?
PostPosted: Tue May 02, 2017 10:34 am 
Offline
Member
Member
User avatar

Joined: Thu Mar 10, 2016 7:35 am
Posts: 167
Location: Lancaster, England, Disunited Kingdom
And just to be awkward my assembler uses a dollar. I picked this up from Borland's Pascal and find it easier to type and easier to recognise.


Top
 Profile  
 
 Post subject: Re: Where would I learn C and Assembly?
PostPosted: Tue May 02, 2017 10:53 am 
Offline
Member
Member

Joined: Mon May 01, 2017 3:56 am
Posts: 44
http://wiki.osdev.org/Printing_to_Screen seems hard. How do I do the parameter for write_string() function? In my main, do I do

Code:
write_string(0x07, "Hello World!");


or not?


Top
 Profile  
 
 Post subject: Re: Where would I learn C and Assembly?
PostPosted: Tue May 02, 2017 11:21 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4594
Location: Chichester, UK
Why not try it and see?


Top
 Profile  
 
 Post subject: Re: Where would I learn C and Assembly?
PostPosted: Tue May 02, 2017 11:27 am 
Offline
Member
Member

Joined: Mon May 01, 2017 3:56 am
Posts: 44
iansjack wrote:
Why not try it and see?


It didn't work! :( what else could I use? Please help.


Top
 Profile  
 
 Post subject: Re: Where would I learn C and Assembly?
PostPosted: Tue May 02, 2017 11:27 am 
Offline
Member
Member

Joined: Wed Oct 30, 2013 1:57 pm
Posts: 306
Location: Germany
Schol-R-LEA wrote:
You have it backwards, I'm afraid, though that isn't hard to do. GAS, being a distant descendant the original Unix assembler, uses the C '0x' prefix, while Intel's own assembler, and the Microsoft Macro Assembler (MASM), use the postfix 'h'. Most of the other x86 assemblers, such as NASM or FASM, can use either, though the C format is usually preferred.
Oops, appears that I've messed up there. It's the other way around, of course #-o
Lesson: never write forum posts after more than a day's worth of work.

_________________
managarm


Top
 Profile  
 
 Post subject: Re: Where would I learn C and Assembly?
PostPosted: Tue May 02, 2017 11:42 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4594
Location: Chichester, UK
john765 wrote:
iansjack wrote:
Why not try it and see?


It didn't work! :( what else could I use? Please help.

Honestly, the Bare Bones tutorial is about as simple as it gets.

You are coming over as wanting hand-holding through the process of writing an OS. It's just not going to happen; there's too much to learn, and this isn't a site for programming beginners.

I think you need to learn how to use C and assembler by writing simple user programs before you get into the relatively advanced world of OS development.

I don't mean to be rude, just realistic.


Top
 Profile  
 
 Post subject: Re: Where would I learn C and Assembly?
PostPosted: Tue May 02, 2017 12:43 pm 
Offline
Member
Member

Joined: Mon May 01, 2017 3:56 am
Posts: 44
iansjack wrote:
john765 wrote:
iansjack wrote:
Why not try it and see?


It didn't work! :( what else could I use? Please help.

Honestly, the Bare Bones tutorial is about as simple as it gets.

You are coming over as wanting hand-holding through the process of writing an OS. It's just not going to happen; there's too much to learn, and this isn't a site for programming beginners.

I think you need to learn how to use C and assembler by writing simple user programs before you get into the relatively advanced world of OS development.

I don't mean to be rude, just realistic.


I know C and Assembly.

Also, I didn't ask for your stupid opinion. I asked how to do the thing for write_string() in C from http://wiki.osdev.org/Printing_to_Screen. You can't even tell me? Insane. I am in reality by the way. It is my option.

That's like judging on my religion. I want to waste my life on OSDev. Otherwise, I wouldn't come here.


Top
 Profile  
 
 Post subject: Re: Where would I learn C and Assembly?
PostPosted: Tue May 02, 2017 12:56 pm 
Offline
Member
Member
User avatar

Joined: Fri Oct 21, 2011 9:47 pm
Posts: 286
Location: Tustin, CA USA
john765 wrote:
I want to learn C and Assembly
john765 wrote:
I know C and Assembly.

In just over 24 hours....

_________________
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


Top
 Profile  
 
 Post subject: Re: Where would I learn C and Assembly?
PostPosted: Tue May 02, 2017 1:08 pm 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4594
Location: Chichester, UK
john765 wrote:
Also, I didn't ask for your stupid opinion. I asked how to do the thing for write_string() in C from http://wiki.osdev.org/Printing_to_Screen. You can't even tell me? Insane. I am in reality by the way. It is my option.

That's like judging on my religion. I want to waste my life on OSDev. Otherwise, I wouldn't come here.
How to win friends and influence people. =D>

It's your option; it's your religion; it's your choice. So just do it.


Top
 Profile  
 
 Post subject: Re: Where would I learn C and Assembly?
PostPosted: Tue May 02, 2017 1:10 pm 
Offline
Member
Member
User avatar

Joined: Tue Aug 02, 2016 1:52 pm
Posts: 286
Location: East Riding of Yorkshire, UK
john765 wrote:
Also, I didn't ask for your stupid opinion. I asked how to do the thing for write_string() in C from http://wiki.osdev.org/Printing_to_Screen. You can't even tell me? Insane.
You just said "It didn't work!". As smart as iansjack is, I don't think that he has any telepathic abilities. Maybe if you weren't so rude and actually put some effort in yourself, you'd get some better help.

_________________
com.sun.java.swing.plaf.nimbus.InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState
Compiler Development Forum


Top
 Profile  
 
 Post subject: Re: Where would I learn C and Assembly?
PostPosted: Tue May 02, 2017 1:22 pm 
Offline
Member
Member
User avatar

Joined: Fri Jan 27, 2017 12:15 pm
Posts: 149
Location: Belgium
I really hope this isn't going the luca1 way.
http://forum.osdev.org/viewtopic.php?f=1&t=31522&p=273583#p273583
And yes, you are entitled to your opinion. Were just giving advice.

_________________
AQUA OS: https://obiwac.wordpress.com/aqua-os/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 61 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 110 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